示例#1
0
        private PNCounter Change(UniqueAddress key, long delta)
        {
            if (delta > 0)
            {
                return(new PNCounter(Increments.Increment(key, (ulong)delta), Decrements));
            }
            if (delta < 0)
            {
                return(new PNCounter(Increments, Decrements.Increment(key, (ulong)(-delta))));
            }

            return(this);
        }
示例#2
0
        private PNCounter Change(UniqueAddress key, BigInteger delta)
        {
            if (delta > 0)
            {
                return(new PNCounter(Increments.Increment(key, delta), Decrements));
            }
            if (delta < 0)
            {
                return(new PNCounter(Increments, Decrements.Increment(key, -delta)));
            }

            return(this);
        }