Use StringBuilderCache in PathInternal.NormalizeDirectorySeparators by stephentoub · Pull Request #21760 · dotnet/coreclr (original) (raw)

stephentoub

When we do need to normalize, we're currently allocating the StringBuilder/char[] for the full path length. As long as the path length is less than the max cacheable size (360), we'll now use a cached builder.

cc: @JeremyKuhne

@stephentoub

When we do need to normalize, we're currently allocating the StringBuilder/char[] for the full path length. As long as the path length is less than the max cacheable size (360), we'll now use a cached builder.

jkotas

@stephentoub

@dotnet-bot test Windows_NT x64 Release CoreFX Tests please

picenka21 pushed a commit to picenka21/runtime that referenced this pull request

Feb 18, 2022

@stephentoub

…otnet/coreclr#21760)

When we do need to normalize, we're currently allocating the StringBuilder/char[] for the full path length. As long as the path length is less than the max cacheable size (360), we'll now use a cached builder.

Commit migrated from dotnet/coreclr@9d159ec