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

◆ TryPop()

bool System.Collections.Generic.Stack< T >.TryPop ( [MaybeNullWhen(false)] out T result)
inline

Definition at line 275 of file Stack.cs.

276 {
277 int num = _size - 1;
278 T[] array = _array;
279 if ((uint)num >= (uint)array.Length)
280 {
281 result = default(T);
282 return false;
283 }
284 _version++;
285 _size = num;
286 result = array[num];
287 if (RuntimeHelpers.IsReferenceOrContainsReferences<T>())
288 {
289 array[num] = default(T);
290 }
291 return true;
292 }

References System.Collections.Generic.Stack< T >._array, System.Collections.Generic.Stack< T >._size, System.Collections.Generic.Stack< T >._version, and System.array.

Referenced by System.Text.RegularExpressions.RegexCompiler.RentInt32Local(), and System.Text.RegularExpressions.RegexCompiler.RentReadOnlySpanCharLocal().