zipAll<B> method

  1. @override
ILazyList<(A, B)> zipAll<B>(
  1. RIterableOnce<B> that,
  2. A thisElem,
  3. B thatElem
)
override

Returns a new collection that combines corresponding elements from this collection and that as a tuple. The length of the returned collection will be the maximum of this collections size and thes size of that. If this collection is shorter than that, thisElem will be used to fill in the resulting collection. If that is shorter, thatElem will be used to will in the resulting collection.

Implementation

@override
ILazyList<(A, B)> zipAll<B>(RIterableOnce<B> that, A thisElem, B thatElem) {
  if (knownIsEmpty) {
    if (that.knownSize == 0) {
      return empty();
    } else {
      return ILazyList.continually(thisElem).zip(that);
    }
  } else {
    if (that.knownSize == 0) {
      return zip(ILazyList.continually(thatElem));
    } else {
      return _newLL(() => _zipAllState(that.iterator, thisElem, thatElem));
    }
  }
}