| Commit message (Collapse) | Author | Age | Files | Lines |
|\ |
|
| |
| |
| |
| |
| | |
Even if no elements fail the predicate (so that the trailing
iterator is empty).
|
| | |
|
| |
| |
| |
| | |
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.
|
|\|
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|/
|
|
| |
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`.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
This also affected sliding and grouped since they defer to GroupedIterator
|