Skip to content

Commit e6257d8

Browse files
authored
Merge pull request #447 from Youssef1313/patch-1
Replace characters from StringBuilder to reduce string allocations
2 parents 1287507 + 230af38 commit e6257d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CommunityToolkit.Mvvm.SourceGenerators/Extensions/INamedTypeSymbolExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ ITypeSymbol ts when ts.ContainingType is ISymbol pt
4040
// one to the outermost namespace, if any. Additionally, the ` and + symbols need to be replaced
4141
// to avoid errors when generating code. This is a known issue with source generators not accepting
4242
// those characters at the moment, see: https://github.com/dotnet/roslyn/issues/58476.
43-
return BuildFrom(symbol, new StringBuilder(256)).ToString().Replace('`', '-').Replace('+', '.');
43+
return BuildFrom(symbol, new StringBuilder(256)).Replace('`', '-').Replace('+', '.').ToString();
4444
}
4545

4646
/// <summary>

0 commit comments

Comments
 (0)