Skip to content

Avoid boxing list/array enumerator in CreateTextLSRuns#6281

Merged
dipeshmsft merged 1 commit intodotnet:mainfrom
stephentoub:textstoreboxing
May 5, 2022
Merged

Avoid boxing list/array enumerator in CreateTextLSRuns#6281
dipeshmsft merged 1 commit intodotnet:mainfrom
stephentoub:textstoreboxing

Conversation

@stephentoub
Copy link
Member

Description

GetTextShapeableSymbols returns an IList<T>, but it's getting treated as an ICollection<T> and thus enumerated. We can index into it instead to avoid some interface dispatch and boxing the enumerator of what's typically a List<T> or a T[].

Customer Impact

Unnecessary allocation/overhead.

Regression

No

Testing

CI

Risk

Minimal

And reduce the interface dispatch along the way.
@stephentoub stephentoub requested a review from a team as a code owner March 18, 2022 14:08
@ghost ghost added the PR metadata: Label to tag PRs, to facilitate with triage label Mar 18, 2022
@ghost ghost requested review from SamBent, dipeshmsft and singhashish-wpf March 18, 2022 14:08
@dipeshmsft dipeshmsft self-assigned this Mar 27, 2022
@ghost ghost assigned stephentoub May 4, 2022
@dipeshmsft dipeshmsft merged commit c83cc34 into dotnet:main May 5, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jun 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

PR metadata: Label to tag PRs, to facilitate with triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants