From be31fef41ad7585af15f3dc61be919ed9dc5ea1a Mon Sep 17 00:00:00 2001 From: Philipp Haller Date: Fri, 31 Jul 2009 14:47:42 +0000 Subject: Fixed #2212. --- .../scala/collection/generic/LinearSequenceTemplate.scala | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/library') 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) } -- cgit v1.2.3