removeWhere method

  1. @override
void removeWhere(
  1. bool predicate(
    1. K key,
    2. V value
    )
)
inherited

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

Implementation

@override
void removeWhere(bool Function(K key, V value) predicate) {
  final emptyKeys = <K>{};
  // TODO(cbracken): iterate over entries
  _map.forEach((K key, C values) {
    _removeWhere(values, key, predicate);
    if (_map[key]!.isEmpty) emptyKeys.add(key);
  });
  emptyKeys.forEach(_map.remove);
}