Skip to content

Stop allocating unnecessary StringBuilders in ParsePropertyComments#6508

Merged
dipeshmsft merged 1 commit intodotnet:mainfrom
stephentoub:parsepropertysb
Jun 3, 2022
Merged

Stop allocating unnecessary StringBuilders in ParsePropertyComments#6508
dipeshmsft merged 1 commit intodotnet:mainfrom
stephentoub:parsepropertysb

Conversation

@stephentoub
Copy link
Member

@stephentoub stephentoub commented May 1, 2022

Description

When we already have a StringBuilder, just clear it rather than allocating a replacement. Also don't ToString() only to then create a new string without the first character; use StringBuilder's ToString that takes an offset and length.

Customer Impact

Unnecessary allocation.

Regression

No

Testing

CI

Risk

Minimal

Microsoft Reviewers: Open in CodeFlow

@stephentoub stephentoub requested a review from a team as a code owner May 1, 2022 00:56
@ghost ghost assigned stephentoub May 1, 2022
@ghost ghost added the PR metadata: Label to tag PRs, to facilitate with triage label May 1, 2022
@ghost ghost requested review from SamBent, dipeshmsft and singhashish-wpf May 1, 2022 00:57
@dipeshmsft dipeshmsft merged commit 732f448 into dotnet:main Jun 3, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jul 3, 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