示例#1
0
 internal void Add(IndexDiff indexDiff)
 {
     Debug.Assert(!this.disposed, "this.disposed");
     lock (this.gate)
     {
         this.needsRefresh = true;
         this.KeyedDiffs[indexDiff.Index] = indexDiff;
         this.UpdateSubBuilder(indexDiff.Index, null);
     }
 }
示例#2
0
            private static int CompareIndex(IndexDiff x, IndexDiff y)
            {
                if (x.Index is int && y.Index is int)
                {
                    return(((int)x.Index).CompareTo(y.Index));
                }

                if ((x.X == PaddedPairs.MissingItem || x.Y == PaddedPairs.MissingItem) &&
                    (y.X == PaddedPairs.MissingItem || y.Y == PaddedPairs.MissingItem))
                {
                    var xv = (x.X == PaddedPairs.MissingItem ? 1 : 0) + (x.Y == PaddedPairs.MissingItem ? -1 : 0);
                    var yv = (y.X == PaddedPairs.MissingItem ? 1 : 0) + (y.Y == PaddedPairs.MissingItem ? -1 : 0);
                    return(xv.CompareTo(yv));
                }

                return(0);
            }