System.Numerics.BigIntegerBuilder.Resize C# (CSharp) Method

Resize() private static method

private static Resize ( uint &array, int newSize ) : void
array uint
newSize int
return void
        private static void Resize(ref uint[] array, int newSize) {
            if (newSize < 0) {
                throw new ArgumentOutOfRangeException("The number must be greater than or equal to zero.");
            }
            uint[] sourceArray = array;
            if (sourceArray == null) {
                array = new uint[newSize];
            }
            else if (sourceArray.Length != newSize) {
                uint[] destinationArray = new uint[newSize];
                Array.Copy(sourceArray, 0, destinationArray, 0, (sourceArray.Length > newSize) ? newSize : sourceArray.Length);
                array = destinationArray;
            }
        }
#endif