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

◆ ToArray()

virtual ? object[] System.Collections.Queue.ToArray ( )
inlinevirtual

Reimplemented in System.Collections.Queue.SynchronizedQueue.

Definition at line 426 of file Queue.cs.

427 {
428 if (_size == 0)
429 {
430 return Array.Empty<object>();
431 }
432 object[] array = new object[_size];
433 if (_head < _tail)
434 {
435 Array.Copy(_array, _head, array, 0, _size);
436 }
437 else
438 {
439 Array.Copy(_array, _head, array, 0, _array.Length - _head);
440 Array.Copy(_array, 0, array, _array.Length - _head, _tail);
441 }
442 return array;
443 }

References System.Collections.Queue._array, System.Collections.Queue._head, System.Collections.Queue._size, System.Collections.Queue._tail, System.array, and System.Array.Copy().

Referenced by System.Collections.Queue.SynchronizedQueue.ToArray().