From ecee4b18ad1496254c87538149eaeb7f10a8b33c Mon Sep 17 00:00:00 2001 From: Aleksandar Pokopec Date: Tue, 10 Nov 2009 22:37:47 +0000 Subject: Changed the ctor of the LinkedList so that it i... Changed the ctor of the LinkedList so that it ignores null if given as the next list. --- src/library/scala/collection/mutable/LinkedList.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/library/scala/collection/mutable/LinkedList.scala b/src/library/scala/collection/mutable/LinkedList.scala index 8e4dbcc437..abd691ef5c 100644 --- a/src/library/scala/collection/mutable/LinkedList.scala +++ b/src/library/scala/collection/mutable/LinkedList.scala @@ -30,8 +30,10 @@ class LinkedList[A]() extends LinearSeq[A] def this(elem: A, next: LinkedList[A]) { this() - this.elem = elem - this.next = next + if (next != null) { + this.elem = elem + this.next = next + } } override def companion: GenericCompanion[LinkedList] = LinkedList -- cgit v1.2.3