removeAll method

BuiltList<V> removeAll(
  1. Object? key
)

As ListMultimap.removeAll, but results are BuiltLists.

Implementation

BuiltList<V> removeAll(Object? key) {
  if (key is! K) return BuiltList<V>();
  _makeWriteableCopy();
  var builder = _builderMap[key];
  if (builder == null) {
    _builderMap[key] = ListBuilder<V>();
    return _builtMap[key] ?? BuiltList<V>();
  }
  var old = builder.build();
  builder.clear();
  return old;
}