[Analyzer] stringBuilder.Append(string.Substring(...)) to stringBuilder.Append(string, ...) #111243
Labels
api-ready-for-review
API is ready for review, it is NOT ready for implementation
area-System.Runtime
code-analyzer
Marks an issue that suggests a Roslyn analyzer
code-fixer
Marks an issue that suggests a Roslyn code fixer
untriaged
New issue has not been triaged by the area owner
This pattern shows up reasonably frequently and ends up allocating an additional string:
https://grep.app/search?q=%5C.Append%5C%28%5Cw%2A%5C.Substring®exp=true&filter[lang][0]=C%23
We should have an analyzer that flags use like:
and a fixer that transforms it into:
The text was updated successfully, but these errors were encountered: