Increase max string length

This commit is contained in:
Garry Newman 2019-06-03 11:09:57 +01:00
parent 33703be387
commit 5b32943aa8

View File

@ -18,20 +18,19 @@ namespace Steamworks
if ( StringBuilderPool == null ) if ( StringBuilderPool == null )
{ {
// //
// The pool has 8 items. This should be safe because we shouldn't really // The pool has 4 items. This should be safe because we shouldn't really
// ever be using more than 2 StringBuilders at the same time. // ever be using more than 2 StringBuilders at the same time.
// //
StringBuilderPool = new StringBuilder[8]; StringBuilderPool = new StringBuilder[4];
for ( int i = 0; i < StringBuilderPool.Length; i++ ) for ( int i = 0; i < StringBuilderPool.Length; i++ )
StringBuilderPool[i] = new StringBuilder( 4096 ); StringBuilderPool[i] = new StringBuilder( 1024 * 32 );
} }
StringBuilderPoolIndex++; StringBuilderPoolIndex++;
if ( StringBuilderPoolIndex >= StringBuilderPool.Length ) if ( StringBuilderPoolIndex >= StringBuilderPool.Length )
StringBuilderPoolIndex = 0; StringBuilderPoolIndex = 0;
StringBuilderPool[StringBuilderPoolIndex].Capacity = 4096;
StringBuilderPool[StringBuilderPoolIndex].Length = 0; StringBuilderPool[StringBuilderPoolIndex].Length = 0;
return StringBuilderPool[StringBuilderPoolIndex]; return StringBuilderPool[StringBuilderPoolIndex];