followedBy method Null safety

Iterable<E> followedBy (
  1. Iterable<E> other
)
override

Returns the lazy concatenation of this iterable and other.

The returned iterable will provide the same elements as this iterable, and, after that, the elements of other, in the same order as in the original iterables.

Implementation

Iterable<E> followedBy(Iterable<E> other) {
  // Type workaround because IterableMixin<E> doesn't promote
  // to EfficientLengthIterable<E>.
  Iterable<E> self = this;
  if (self is EfficientLengthIterable<E>) {
    return FollowedByIterable<E>.firstEfficient(self, other);
  }
  return FollowedByIterable<E>(this, other);
}