clear method

IMapOfSets<K, V> clear()

If removeEmptySets is true, returns an empty map of sets with the same configuration. However, if removeEmptySets is false, keep the keys, but make their sets empty.

Implementation

IMapOfSets<K, V> clear() {
  if (config.removeEmptySets)
    return empty<K, V>(config);
  else {
    var emptySet = ISetImpl.empty<V>(config.asConfigSet);
    return updateAll((K key, ISet<V> set) => emptySet);
  }
}