Lidgren.Network.NetBigInteger.CompareNoLeadingZeroes C# (CSharp) Method

CompareNoLeadingZeroes() private static method

private static CompareNoLeadingZeroes ( int xIndx, int x, int yIndx, int y ) : int
xIndx int
x int
yIndx int
y int
return int
        private static int CompareNoLeadingZeroes(
			int xIndx,
			int[] x,
			int yIndx,
			int[] y)
        {
            int diff = (x.Length - y.Length) - (xIndx - yIndx);

            if (diff != 0)
            {
                return diff < 0 ? -1 : 1;
            }

            // lengths of magnitudes the same, test the magnitude values

            while (xIndx < x.Length)
            {
                uint v1 = (uint)x[xIndx++];
                uint v2 = (uint)y[yIndx++];

                if (v1 != v2)
                    return v1 < v2 ? -1 : 1;
            }

            return 0;
        }