Beispiel #1
0
        /// <summary>
        /// Removes an item from the set, or does nothing if the item does not exist.
        /// </summary>
        /// <param name="item">The item to remove.</param>
        /// <returns></returns>
        public override ImmSet <T> Remove(T item)
        {
            var ret = Root.Root_Remove(item, Lineage.Mutable());

            if (ret == null)
            {
                return(this);
            }
            return(ret.Wrap(EqualityComparer));
        }
Beispiel #2
0
        /// <summary>
        ///     Removes the specified key from the map, or does nothing if the key doesn't exist.
        /// </summary>
        /// <param name="k">The key.</param>
        /// <returns></returns>
        public override ImmMap <TKey, TValue> Remove(TKey k)
        {
            var removed = _root.Root_Remove(k, Lineage.Mutable());

            if (removed == null)
            {
                return(this);
            }
            return(removed.WrapMap(_equality));
        }
Beispiel #3
0
            public bool Remove(T item)
            {
                var res = _inner.Root_Remove(item, _lineage);

                if (res == null)
                {
                    return(false);
                }
                _inner = res;
                return(true);
            }
Beispiel #4
0
            public bool Remove(TKey key)
            {
                var ret = _inner.Root_Remove(key, _lineage);

                if (ret == null)
                {
                    return(false);
                }
                else
                {
                    _inner = ret;
                    return(true);
                }
            }