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

Avoid boxing list enumerator in XamlObjectWriter.Logic_ConvertPositionalParamsToArgs #6279

Merged
merged 1 commit into from May 5, 2022

Conversation

stephentoub
Copy link
Member

Description

Logic_ConvertPositionalParamsToArgs is using foreach with an IList<> it gets back from GetPositionalParameters. Doing so will end up boxing the enumerator, typically of a List<T>, when we can instead just use a for loop with the IList<>, avoiding the boxing and reducing interface calls.

Customer Impact

Unnecessary allocation and interface dispatch.

Regression

No

Testing

CI

Risk

Minimal

@stephentoub stephentoub requested a review from a team as a code owner March 18, 2022 13:27
@ghost ghost added the PR metadata: Label to tag PRs, to facilitate with triage label Mar 18, 2022
@ghost ghost requested review from dipeshmsft, singhashish-wpf and SamBent March 18, 2022 13:27
@dipeshmsft dipeshmsft self-assigned this Mar 31, 2022
@ghost ghost assigned stephentoub May 4, 2022
@dipeshmsft dipeshmsft merged commit 2fe957d into dotnet:main May 5, 2022
@dotnet dotnet 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.

None yet

2 participants