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

Commit d265eba

Browse files
bbowyersmythjkotas
authored andcommitted
Return StringBuilder back to cache when not making any replacements (#15677)
1 parent 7b1be11 commit d265eba

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/mscorlib/src/System/String.Manipulation.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -999,6 +999,7 @@ private unsafe String ReplaceCore(string oldValue, string newValue, CultureInfo
999999
// small optimization,
10001000
// if we have not done any replacements,
10011001
// we will return the original string
1002+
StringBuilderCache.Release(result);
10021003
return this;
10031004
}
10041005
else

0 commit comments

Comments
 (0)