Пример #1
0
        /// <summary>
        /// Removes a key from the map, or does nothing if the key does not exist.
        /// </summary>
        /// <param name="key">The key to remove.</param>
        /// <returns></returns>
        public override ImmSortedMap <TKey, TValue> Remove(TKey key)
        {
            var removed = Root.AvlRemove(key, Lineage.Mutable());

            if (removed == null)
            {
                return(this);
            }
            return(removed.WrapMap(Comparer));
        }
Пример #2
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 ImmSortedSet <T> Remove(T item)
        {
            var ret = Root.AvlRemove(item, Lineage.Mutable());

            if (ret == null)
            {
                return(this);
            }
            return(ret.Wrap(Comparer));
        }
Пример #3
0
            public bool Remove(TKey key)
            {
                var ret = _inner.AvlRemove(key, _lineage);

                if (ret == null)
                {
                    return(false);
                }
                _inner = ret;
                return(true);
            }
Пример #4
0
            public bool Remove(T item)
            {
                var ret = _inner.AvlRemove(item, _lineage);

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