示例#1
0
        public LastWriteWinsElementSet <T> Merge(LastWriteWinsElementSet <T> elementSet)
        {
            var mergedElementSet = new LastWriteWinsElementSet <T>(_comparer);

            UnionSet(mergedElementSet._addSet, _addSet);
            UnionSet(mergedElementSet._addSet, elementSet._addSet);
            UnionSet(mergedElementSet._removeSet, _removeSet);
            UnionSet(mergedElementSet._removeSet, elementSet._removeSet);
            mergedElementSet.ResolveConflicts();
            return(mergedElementSet);
        }
示例#2
0
 /// <summary>
 /// Determines if this element set is less than or equal to another element set
 /// </summary>
 /// <param name="elementSet">The other element set</param>
 /// <returns>A boolean to indicate that whether this element set is less or equal to another element set</returns>
 public bool Compare(LastWriteWinsElementSet <T> elementSet) =>
 IsSubset(_addSet, elementSet._addSet) &&
 IsSubset(_removeSet, elementSet._removeSet);