public void CloneIsEqual() { var l = new PtrLenList(); l.TryInclude(0, 1); l.TryInclude(10, 11); var l2 = l.Clone(); Assert.AreEqual("0-1;10-21", Str(l2)); Assert.AreEqual("0-1;10-21", Str(l)); }
public PtrLenList MergeIntoNew(PtrLenList mergeWith) { if (mergeWith == null || mergeWith.Empty) { return(Clone()); } if (Empty) { return(mergeWith.Clone()); } // TODO: optimize this var result = Clone(); foreach (var range in mergeWith) { result.TryInclude(range.Key, range.Value); } return(result); }
public PtrLenList MergeIntoNew(PtrLenList mergeWith) { if (mergeWith == null || mergeWith.Empty) return Clone(); if (Empty) return mergeWith.Clone(); // TODO: optimize this var result = Clone(); foreach (var range in mergeWith) { result.TryInclude(range.Key, range.Value); } return result; }
public void EmptyCloneIsEmpty() { var l = new PtrLenList(); var l2 = l.Clone(); Assert.IsTrue(l2.Empty); }