summaryrefslogtreecommitdiff
path: root/test/files/run/t8428.scala
Commit message (Collapse)AuthorAgeFilesLines
* SI-8428 Fix regression in iterator concatenationJason Zaugg2014-03-201-0/+12
Regressed in e3ddb2d7, which introduced `ConcatIterator` to avoid super-linear runtime on chains of concatenated iterators. `ConcatIterator` maintains a queue of thunks for the remaining iterators. Both `next` and `hasNext` delegate to `advance`, which evaluates the thunks and discards any empty iterators from the start of the queue. The first non-empty iterator is stored in the var `current`. It also overrides `++`, and creates a new `ConcatIterator` with the given `that` as an extra element in the queue. However, it failed to copy `current` across, which led to data loss.