removeWhere method

  1. @override
void removeWhere (bool test(K key, V value))
override

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

Implementation

@override
void removeWhere(bool test(K key, V value)) {
  var keysToRemove = <K>[];
  _entries.forEach((key, entry) {
    if (test(key, entry.value)) keysToRemove.add(key);
  });
  for (var key in keysToRemove) {
    remove(key);
  }
}