Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/pyright-internal/src/analyzer/importLogger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ export class ImportLogger {
}

getLogs() {
return this._logs;
return [...this._logs];

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should avoid copying the array at runtime which could potentially impact performance by just widening the return type to readonly string[] instead. this also prevents the returned list from being mutated, which shouldn't be allowed either

    getLogs(): readonly string[] {
        return this._logs;
    }
}

}
}
Loading