Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use GetContainingLineNumber() to reduce allocations #68605

Merged

Conversation

drewnoakes
Copy link
Member

Calling GetContainingLine().LineNumber causes TextSnapshotLine allocations. The GetContainingLineNumber() method avoids these.

@drewnoakes drewnoakes requested a review from a team as a code owner June 14, 2023 01:36
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 14, 2023
@drewnoakes drewnoakes force-pushed the fix-1827511-get-line-number-allocations branch from d4f13bd to 1ff1d7e Compare June 14, 2023 02:11
Calling `GetContainingLine().LineNumber` causes `TextSnapshotLine` allocations. The `GetContainingLineNumber()` method avoids these.
@drewnoakes drewnoakes force-pushed the fix-1827511-get-line-number-allocations branch from 1ff1d7e to 30681a6 Compare June 14, 2023 02:48
@CyrusNajmabadi CyrusNajmabadi enabled auto-merge (squash) June 14, 2023 03:18
@CyrusNajmabadi
Copy link
Member

Thanks!

@CyrusNajmabadi CyrusNajmabadi merged commit 17b7e5d into dotnet:main Jun 14, 2023
@ghost ghost added this to the Next milestone Jun 14, 2023
@drewnoakes drewnoakes deleted the fix-1827511-get-line-number-allocations branch June 14, 2023 07:23
@RikkiGibson RikkiGibson modified the milestones: Next, 17.7 P3 Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants