Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 0fa3956

Browse files
committed
Merge pull request #2277 from AustinWise/issue-#2275
Release the StringBuilder back to the StringBuilderCache.
2 parents 67f73d0 + ff7a4b0 commit 0fa3956

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/System.Runtime.Extensions/src/System/IO/Path.Unix.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,12 @@ private static string NormalizePath(
134134
throw new PathTooLongException(SR.IO_PathTooLong);
135135
}
136136

137-
return
137+
string result =
138138
sb.Length == 0 ? (fullCheck ? DirectorySeparatorCharAsString : string.Empty) :
139139
sb.Length == path.Length ? path :
140140
sb.ToString();
141+
StringBuilderCache.Release(sb);
142+
return result;
141143
}
142144

143145
private static string RemoveLongPathPrefix(string path)

0 commit comments

Comments
 (0)