sameElements method

bool sameElements(
  1. RIterable<A> that
)
inherited

Returns true if this collection has the same elements, in the same order, as that.

Implementation

bool sameElements(RIterable<A> that) {
  final thisKnownSize = knownSize;
  final thatKnownSize = that.knownSize;
  final knownDifference = thisKnownSize != -1 &&
      thatKnownSize != -1 &&
      thisKnownSize != thatKnownSize;

  return !knownDifference && iterator.sameElements(that);
}