Beispiel #1
0
 internal Enumerator(FastStack <T> stack)
 {
     _stack          = stack;
     _version        = stack._version;
     _index          = -2;
     _currentElement = default(T);
 }
Beispiel #2
0
        public void CopyTo(FastStack <T> srcStack)
        {
            Debug.Assert(srcStack._array != _array);

            int srcSize  = srcStack._size;
            int dstIndex = _size;

            if (dstIndex + srcSize > _array.Length)
            {
                Array.Resize(ref _array, dstIndex + srcSize + 4 * DefaultCapacity);
            }

            var srcArray  = srcStack._array;
            var destArray = _array;
            int srcIndex  = 0;

            for (int i = 0; i < srcSize; i++)
            {
                destArray[dstIndex++] = srcArray[srcIndex++];
            }
        }