scala / collection-strawman

Implementation of the new Scala 2.13 Collections
Apache License 2.0
200 stars 72 forks source link

Bring back Iterator.duplicate #563

Closed lrytz closed 6 years ago

lrytz commented 6 years ago

The difference to using View.from(iterator) is that the view caches all values that are read from the iterator. For the two iterators obtained with Iterator.duplicate, only those values that are between the current cursors of the two iterators are cached.