public void AddRange(IEnumerable <KeyValuePair <TKey, TValue> > items) { items.CheckNotNull("items"); ImmMap <TKey, TValue> map = items as ImmMap <TKey, TValue>; if (map != null && _equality.Equals(map._equality)) { _inner = _inner.Union(map._root, _lineage); } else { items.ForEach(x => Add(x)); } }
public void AddRange(IEnumerable <T> items) { items.CheckNotNull("items"); var set = items as ImmSet <T>; if (set != null && _eq.Equals(set.EqualityComparer)) { _inner = _inner.Union(set.Root, _lineage); } else { items.ForEach(x => { _inner = _inner.Root_Add(x, true, _lineage, _eq, false) ?? _inner; }); } }
protected override ImmSet <T> Union(ImmSet <T> other) { return(Root.Union(other.Root, Lineage.Mutable()).Wrap(EqualityComparer)); }
protected override ImmMap <TKey, TValue> Merge(ImmMap <TKey, TValue> other, ValueSelector <TKey, TValue, TValue, TValue> collision = null) { return(_root.Union(other._root, Lineage.Mutable(), collision).WrapMap(_equality)); }