withoutFirst method

Iterable<T> withoutFirst()

Lazily returns all values without the first one.

Example:

[1, 2, 3].withoutFirst(); // [2, 3]
[].withoutFirst(); // [];

Implementation

Iterable<T> withoutFirst() sync* {
  var iter = iterator;

  iter.moveNext(); // eat the first

  while (iter.moveNext()) {
    yield iter.current;
  }
}