Пример #1
0
        /// <summary>
        /// Atomically removes a set of keys from the map
        /// </summary>
        /// <param name="keys">Keys to remove</param>
        /// <returns>New map with the items removed</returns>
        public Map <K, V> RemoveRange(IEnumerable <K> keys)
        {
            var self = Root;

            foreach (var key in keys)
            {
                self = MapModule.Remove(self, key, Comparer <K> .Default);
            }
            return(SetRoot(self));
        }
Пример #2
0
 /// <summary>
 /// Atomically removes an item from the map
 /// If the key doesn't exists, the request is ignored.
 /// </summary>
 /// <param name="key">Key</param>
 /// <returns>New map with the item removed</returns>
 public Map <K, V> Remove(K key) =>
 isnull(key)
         ? this
         : SetRoot(MapModule.Remove(Root, key, Comparer <K> .Default));