Skip to content

Commit f8f7414

Browse files
snakefoot304NotModified
authored andcommitted
StringBuilderPool - Allow FastPool-object to have larger capacity, but remember to reset (#3345)
1 parent adeb5c0 commit f8f7414

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/NLog/Internal/StringBuilderPool.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,10 @@ private void Release(StringBuilder stringBuilder, int poolIndex)
9999
{
100100
stringBuilder = new StringBuilder(maxBuilderCapacity / 2);
101101
}
102-
}
103-
else
104-
{
105-
stringBuilder.Length = 0;
106102
}
107103

104+
stringBuilder.Length = 0;
105+
108106
if (poolIndex == -1)
109107
{
110108
_fastPool = stringBuilder;

0 commit comments

Comments
 (0)