diff options
author | Paul Phillips <paulp@improving.org> | 2009-05-09 03:37:22 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-05-09 03:37:22 +0000 |
commit | f7ab13b08e085c3bf94d857fc9648ee724e4cb08 (patch) | |
tree | 721fb2e3c210a0c40186dada6bed8bb471246368 | |
parent | 68bb95dc3553a5b4f8def3a158df268a1df7ae51 (diff) | |
download | scala-f7ab13b08e085c3bf94d857fc9648ee724e4cb08.tar.gz scala-f7ab13b08e085c3bf94d857fc9648ee724e4cb08.tar.bz2 scala-f7ab13b08e085c3bf94d857fc9648ee724e4cb08.zip |
finitized an infinite loop in sameElements
-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) } |