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; }
internal Enumerator(ArrayQueue <T> queue) { this.elements = queue.elements; this.last = queue.enqueueOffset; this.offset = queue.Count == 0 ? last : queue.dequeueOffset - 1; }