Пример #1
0
        /// <summary>
        /// Resizes the specified newsize.
        /// </summary>
        /// <param name="newsize">The newsize.</param>
        public void Resize(int newsize)
        {
            int[]             newNext         = new int[newsize];
            int[]             newPrev         = new int[newsize];
            InstructionData[] newInstructions = new InstructionData[newsize];

            _next.CopyTo(newNext, 0);
            _prev.CopyTo(newPrev, 0);

            for (int i = _size; i < newsize; ++i)
            {
                newNext[i] = i + 1;
                newPrev[i] = i - 1;
            }
            newNext[newsize - 1] = -1;
            newPrev[_size]       = -1;
            Data.CopyTo(newInstructions, 0);

            _free = _size;
            _next = newNext;
            _prev = newPrev;
            _size = newsize;
            Data  = newInstructions;
        }
Пример #2
0
        /// <summary>
        /// Resizes the specified newsize.
        /// </summary>
        /// <param name="newsize">The newsize.</param>
        public void Resize(int newsize)
        {
            int[] newNext = new int[newsize];
            int[] newPrev = new int[newsize];
            InstructionData[] newInstructions = new InstructionData[newsize];

            _next.CopyTo (newNext, 0);
            _prev.CopyTo (newPrev, 0);

            for (int i = _size; i < newsize; ++i)
            {
                newNext[i] = i + 1;
                newPrev[i] = i - 1;
            }
            newNext[newsize - 1] = -1;
            newPrev[_size] = -1;
            Data.CopyTo (newInstructions, 0);

            _free = _size;
            _next = newNext;
            _prev = newPrev;
            _size = newsize;
            Data = newInstructions;
        }