diff options
Diffstat (limited to 'src/library/scala/collection/generic/SequenceTemplate.scala')
-rw-r--r-- | src/library/scala/collection/generic/SequenceTemplate.scala | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/library/scala/collection/generic/SequenceTemplate.scala b/src/library/scala/collection/generic/SequenceTemplate.scala index 8e54e399eb..b9a398b68c 100644 --- a/src/library/scala/collection/generic/SequenceTemplate.scala +++ b/src/library/scala/collection/generic/SequenceTemplate.scala @@ -506,7 +506,10 @@ trait SequenceTemplate[+A, +This <: IterableTemplate[A, This] with Sequence[A]] def equalsWith[B](that: Sequence[B])(f: (A,B) => Boolean): Boolean = { val i = this.iterator val j = that.iterator - while (i.hasNext && j.hasNext && f(i.next, j.next)) () + while (i.hasNext && j.hasNext) + if (!f(i.next, j.next)) + return false + !i.hasNext && !j.hasNext } |