Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GrowCore()

void System.Runtime.CompilerServices.DefaultInterpolatedStringHandler.GrowCore ( uint requiredMinCapacity)
inlineprivate

Definition at line 378 of file DefaultInterpolatedStringHandler.cs.

379 {
380 uint value = Math.Max(requiredMinCapacity, Math.Min((uint)(_chars.Length * 2), 1073741791u));
381 int minimumLength = (int)Math.Clamp(value, 256u, 2147483647u);
382 char[] array = ArrayPool<char>.Shared.Rent(minimumLength);
383 _chars.Slice(0, _pos).CopyTo(array);
384 char[] arrayToReturnToPool = _arrayToReturnToPool;
386 if (arrayToReturnToPool != null)
387 {
388 ArrayPool<char>.Shared.Return(arrayToReturnToPool);
389 }
390 }
static ArrayPool< T > Shared
Definition ArrayPool.cs:7
Span< T > Slice(int start)
Definition Span.cs:271
int Length
Definition Span.cs:70

References System.Runtime.CompilerServices.DefaultInterpolatedStringHandler._arrayToReturnToPool, System.Runtime.CompilerServices.DefaultInterpolatedStringHandler._chars, System.Runtime.CompilerServices.DefaultInterpolatedStringHandler._pos, System.array, System.Math.Clamp(), System.Span< T >.Length, System.Math.Max(), System.Math.Min(), System.Buffers.ArrayPool< T >.Shared, System.Span< T >.Slice(), and System.value.

Referenced by System.Runtime.CompilerServices.DefaultInterpolatedStringHandler.Grow(), and System.Runtime.CompilerServices.DefaultInterpolatedStringHandler.Grow().