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

◆ AllocateBuffer()

void System.Collections.Generic.LargeArrayBuilder< T >.AllocateBuffer ( )
inlineprivate

Definition at line 167 of file LargeArrayBuilder.cs.

168 {
169 if ((uint)_count < 8u)
170 {
171 int num = Math.Min((_count == 0) ? 4 : (_count * 2), _maxCapacity);
172 _current = new T[num];
173 Array.Copy(_first, _current, _count);
175 return;
176 }
177 int num2;
178 if (_count == 8)
179 {
180 num2 = 8;
181 }
182 else
183 {
184 _buffers.Add(_current);
185 num2 = Math.Min(_count, _maxCapacity - _count);
186 }
187 _current = new T[num2];
188 _index = 0;
189 }
System.Collections.Generic.ArrayBuilder< T[]> _buffers

References System.Collections.Generic.LargeArrayBuilder< T >._buffers, System.Collections.Generic.LargeArrayBuilder< T >._count, System.Collections.Generic.LargeArrayBuilder< T >._current, System.Collections.Generic.LargeArrayBuilder< T >._first, System.Collections.Generic.LargeArrayBuilder< T >._index, System.Collections.Generic.LargeArrayBuilder< T >._maxCapacity, System.Array.Copy(), and System.Math.Min().

Referenced by System.Collections.Generic.LargeArrayBuilder< T >.AddWithBufferAllocation(), and System.Collections.Generic.LargeArrayBuilder< T >.AddWithBufferAllocation().