Esempio n. 1
0
        public static int operator -(SequenceId a, SequenceId b)
        {
            int difference = SequenceId.GetDifference(a, b) >> SequenceId.BIT_SHIFT;

            // We need to skip 0 since it's not a valid number
            if (a.rawValue < b.rawValue)
            {
                if (difference > 0)
                {
                    difference--;
                }
            }
            else
            {
                if (difference < 0)
                {
                    difference++;
                }
            }

            return(difference);
        }
Esempio n. 2
0
        public static bool operator <=(SequenceId a, SequenceId b)
        {
            int difference = SequenceId.GetDifference(a, b);

            return(difference <= 0);
        }