From da60dda202f386ed85fa15bf8fe02252d4dfb911 Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Fri, 5 Sep 2014 00:24:27 -0700 Subject: SI-8835 Iterator tests can be junit 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. --- src/library/scala/collection/Iterator.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/library') diff --git a/src/library/scala/collection/Iterator.scala b/src/library/scala/collection/Iterator.scala index 0115cc154c..20712f918c 100644 --- a/src/library/scala/collection/Iterator.scala +++ b/src/library/scala/collection/Iterator.scala @@ -322,8 +322,8 @@ trait Iterator[+A] extends TraversableOnce[A] { */ def drop(n: Int): Iterator[A] = { var j = 0 - while (j < n && this.hasNext) { - this.next + while (j < n && hasNext) { + next() j += 1 } this -- cgit v1.2.3