diff options
author | Philipp Haller <hallerp@gmail.com> | 2009-07-31 14:47:42 +0000 |
---|---|---|
committer | Philipp Haller <hallerp@gmail.com> | 2009-07-31 14:47:42 +0000 |
commit | be31fef41ad7585af15f3dc61be919ed9dc5ea1a (patch) | |
tree | 1c5b17ca8cbb43f1e0af8996ec5d36ef41944642 /src | |
parent | bd1e6e09342412a042cf7582124e90e12720e2ba (diff) | |
download | scala-be31fef41ad7585af15f3dc61be919ed9dc5ea1a.tar.gz scala-be31fef41ad7585af15f3dc61be919ed9dc5ea1a.tar.bz2 scala-be31fef41ad7585af15f3dc61be919ed9dc5ea1a.zip |
Fixed #2212.
Diffstat (limited to 'src')
-rw-r--r-- | src/library/scala/collection/generic/LinearSequenceTemplate.scala | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/library/scala/collection/generic/LinearSequenceTemplate.scala b/src/library/scala/collection/generic/LinearSequenceTemplate.scala index 6dcf96fce4..2e1f61a36f 100644 --- a/src/library/scala/collection/generic/LinearSequenceTemplate.scala +++ b/src/library/scala/collection/generic/LinearSequenceTemplate.scala @@ -280,11 +280,16 @@ trait LinearSequenceTemplate[+A, +This <: LinearSequenceTemplate[A, This] with L case that1: LinearSequence[_] => var these = this var those = that1 - while (!these.isEmpty && !those.isEmpty && these.head == those.head) { + while (these != null && those != null && !these.isEmpty && !those.isEmpty && these.head == those.head) { these = these.tail those = those.tail } - these.isEmpty && those.isEmpty + if (these == null) + those == null + else if (those == null) + false + else + these.isEmpty && those.isEmpty case _ => super.sameElements(that) } |