Пример #1
0
        public void CopyTo(ArrayQueue <T> queue)
        {
            if (queue.elements.Length < Count)
            {
                queue.elements = new T[Count];
            }

            Array.Copy(elements, dequeueOffset, queue.elements, 0, Count);
            queue.dequeueOffset = 0;
            queue.enqueueOffset = Count;
        }
Пример #2
0
 internal Enumerator(ArrayQueue <T> queue)
 {
     this.elements = queue.elements;
     this.last     = queue.enqueueOffset;
     this.offset   = queue.Count == 0 ? last : queue.dequeueOffset - 1;
 }