corresponds<U> method

bool corresponds<U>(
  1. Iterable<U> others,
  2. EQ eq
)

Return true if length match and all Eq are true

Implementation

bool corresponds<U>(Iterable<U> others, EQ eq) {
  if (length != others.length) return false;
  final iterator = others.iterator;
  for (T item in this) {
    final next = iterator.moveNext();
    if (!next) return false;
    U other = iterator.current;
    if (!eq(item, other)) return false;
  }
  return true;
}