Skip to content

Commit 02fca85

Browse files
committed
[nomerge] ConcatIterator.last advances
1 parent 8a63f12 commit 02fca85

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

library/src/scala/collection/Iterator.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ object Iterator {
192192
}
193193
else {
194194
current = tail.headIterator
195+
if (last eq tail) last = last.tail
195196
tail = tail.tail
196197
merge()
197198
if (currentHasNextChecked) true
@@ -210,6 +211,7 @@ object Iterator {
210211
current = c.current
211212
currentHasNextChecked = c.currentHasNextChecked
212213
if (c.tail ne null) {
214+
if (last eq null) last = c.last
213215
c.last.tail = tail
214216
tail = c.tail
215217
}

0 commit comments

Comments
 (0)