summaryrefslogtreecommitdiff
path: root/test/junit/scala/collection/IteratorTest.scala
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit 'b9a16c4' into 2.12.xJason Zaugg2016-11-081-0/+6
|\
| * SI-9913 Lead span iterator finishes at state -1Som Snytt2016-09-051-0/+6
| | | | | | | | | | Even if no elements fail the predicate (so that the trailing iterator is empty).
| * SI-9766 - allow ++ on empty ConcatIteratorMartijn Hoekstra2016-05-211-0/+18
| |
* | SI-9691 BufferedIterator should expose a headOptionChristopher Davenport2016-07-151-0/+28
| | | | | | | | This exposes a new API to the BufferedIterator trait. It will return the next element of an iterator as an Option. The return will be Some(value) if there is a next value, and None if there is not a next element.
* | Merge branch '2.11.x' into topic/merge-2.11.x-to-2.12.x-20160210Jason Zaugg2016-02-101-0/+28
|\| | | | | | | | | | | | | | | | | Conflicts: src/library/scala/collection/Iterator.scala | `-- trivial conflicts only. Parens were added to the next() calls in 2.12.x, while in the meantime `{Concat,Join}Iterator` were optimized in 2.11.x
| * SI-9623 Avoid unnecessary hasNext calls in JoinIterator & ConcatIteratorStefan Zeiger2016-02-011-0/+28
| | | | | | | | | | | | | | | | | | | | | | These iterator implementations are used to concatenate two (JoinIterator) or more (ConcatIterator) other iterators with `++`. They used to perform many unnecessary calls to the child iterators’ `hasNext` methods. This improved state machine-based implementation reduces that number to the bare minimum, i.e. iterating over concatenated iterators with `foreach` calls the children's `hasNext` methods a total of (number of children) + (number of elements) times, the same as when iterating over all children separately.
* | Merge branch '2.11.x' into merge/2.11.x-to-2.12.x-20150624Jason Zaugg2015-06-241-0/+10
|\|
| * SI-9332 Iterator.span exhausts leading iteratorSom Snytt2015-05-271-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | Since the leading and trailing iterators returned by span share the underlying iterator, the leading iterator must flag when it is exhausted (when the span predicate fails) since the trailing iterator will advance the underlying iterator. It would also be possible to leave the failing element in the leading lookahead buffer, where it would forever fail the predicate, but that entails evaluating the predicate twice, on both enqueue and dequeue.
* | SI-8627 Two-argument indexOf does not work for IteratorRui Gonçalves2015-04-041-0/+22
|/ | | | Adds two new methods to `Iterator`, overloading `indexOf` and `indexWhere` with a two-arg version whose second argument indicates the index where to start the search. These methods were already present in instances of `GenSeqLike` but not on iterators, leading to strange behavior when two arguments were passed to `indexOf`.
* SI-8835 Update iterator testsSom Snytt2014-11-131-50/+35
| | | | | | | | Addressing feedback from the collections test czar, updated a few of the primitive tests. Avoided testing addition and just asserted. Updated indexOf test to test Iterator.indexOf.
* SI-8835 Iterator tests can be junitSom Snytt2014-11-111-2/+146
| | | | | | | | | | Without loss of generality or convenience, but helps reduce the number of files in test/files and may reduce compile times for test suite. This commit includes the fix from #3963 and an extra test of that fix that ensures the stack doesn't grow on chained drops.
* SI-8475 GroupedIterator is also lazy when paddedSom Snytt2014-05-271-0/+8
| | | | | | | | This is the related case which dnlgtm in the previous fix. The old code seems to be tilting for laziness, but we have to fill the buffer with the current group anyway, so there is no reason to be coy about calling ArrayBuffer.length.
* SI-8475 Fix off by one in GroupedIterator when StreamingJean-Remi Desjardins2014-05-091-0/+20
This also affected sliding and grouped since they defer to GroupedIterator