diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/library/scala/collection/generic/LinearSequenceTemplate.scala | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/library/scala/collection/generic/LinearSequenceTemplate.scala b/src/library/scala/collection/generic/LinearSequenceTemplate.scala index 30c2b92382..764f33651e 100644 --- a/src/library/scala/collection/generic/LinearSequenceTemplate.scala +++ b/src/library/scala/collection/generic/LinearSequenceTemplate.scala @@ -277,9 +277,12 @@ trait LinearSequenceTemplate[+A, +This <: LinearSequenceTemplate[A, This] with L */ override def sameElements[B >: A](that: Iterable[B]): Boolean = that match { case that1: LinearSequence[_] => - val these = this - val those = that1 - while (!these.isEmpty && !those.isEmpty && these.head == those.head) {} + var these = this + var those = that1 + while (!these.isEmpty && !those.isEmpty && these.head == those.head) { + these = these.tail + those = those.tail + } these.isEmpty && those.isEmpty case _ => super.sameElements(that) } |