clone method

  1. @override
Zip<T, U> clone()
override

An iterator which is a "clone" of the original iterator. Iterating through the original or the clone will not affect the other. Do not modify the original collection the original Iterable is based on while iterating. See Clone for more information.

Implementation

@override
Zip<T, U> clone() {
  final newT = Clone._trackable(_iteratorT);
  final newU = Clone._trackable(_iteratorU);
  _iteratorT = newT;
  _iteratorU = newU;
  return Zip(Clone._clone(newT).iterator, Clone._clone(newU).iterator)
    .._current = _current;
}