exists method

bool exists(
  1. Function1<A, bool> p
)
inherited

Returns true if any element of this collection satisfies the given predicate, false if no elements satisfy it.

Implementation

bool exists(Function1<A, bool> p) {
  var res = false;
  final it = iterator;

  while (!res && it.hasNext) {
    res = p(it.next());
  }

  return res;
}