retainAll method

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

See Set.retainAll

Implementation

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