retainAll method

  1. @override
void retainAll(
  1. Iterable<Object?> elements
)
override

Implementation

@override
void retainAll(Iterable<Object?> elements) {
  List<V> chosen = <V>[];
  for (final target in elements) {
    if (target is V && contains(target)) {
      chosen.add(target);
    }
  }
  clear();
  addAll(chosen);
}