eq<U> method

  1. @override
bool eq<U>(
  1. Iterator<U> other
)

Determines if the elements of this Iterator are equal to those of another using "==".

Implementation

@override
bool eq<U>(Iterator<U> other) {
  while (true) {
    if (moveNext()) {
      if (other.moveNext()) {
        if (current != other.current) {
          return false;
        }
      } else {
        return false;
      }
    } else {
      if (other.moveNext()) {
        return false;
      }
      return true;
    }
  }
}