Пример #1
0
            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));
                }
            }
Пример #2
0
            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;
                    });
                }
            }
Пример #3
0
 protected override ImmSet <T> Union(ImmSet <T> other)
 {
     return(Root.Union(other.Root, Lineage.Mutable()).Wrap(EqualityComparer));
 }
Пример #4
0
 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));
 }