removeWhere method

M<K, V> removeWhere(
  1. bool predicate(
    1. K key,
    2. V value
    )
)

Removes all entries of this map that satisfy the given predicate.

Implementation

M<K, V> removeWhere(bool Function(K key, V value) predicate) {
  Map<K, V> oldMap = unlock;
  int oldLength = oldMap.length;
  Map<K, V> newMap = oldMap..removeWhere(predicate);
  return (newMap.length == oldLength) ? this : MFlat<K, V>.unsafe(newMap);
}