equal method

bool equal(
  1. List<T> other
)

Returns true if the equality this(i) == other(i) holds for each index i.

Implementation

bool equal(List<T> other) {
  if (this == other) return true;
  if (length != other.length) return false;
  final it = iterator;
  final oit = other.iterator;
  while (it.moveNext() && oit.moveNext()) {
    if (it.current != oit.current) {
      return false;
    }
  }
  return true;
}