Use StringBuilderCache in PathInternal.NormalizeDirectorySeparators (#21760)
commit4e16ade79482c23fcd76d36ed1e3bae8ba454af0
authorStephen Toub <stoub@microsoft.com>
Wed, 2 Jan 2019 23:16:56 +0000 (2 18:16 -0500)
committerMarek Safar <marek.safar@gmail.com>
Thu, 3 Jan 2019 08:44:24 +0000 (3 09:44 +0100)
tree44e451053408cfdc543b4e2ceb5ea8eaf3c85b4b
parent91ca78d6988a55424a3a911c055f6d695609f8a3
Use StringBuilderCache in PathInternal.NormalizeDirectorySeparators (#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.

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
netcore/System.Private.CoreLib/shared/System/IO/PathInternal.Windows.cs