diff options
author | Aleksandar Pokopec <aleksandar.prokopec@epfl.ch> | 2009-11-10 22:37:47 +0000 |
---|---|---|
committer | Aleksandar Pokopec <aleksandar.prokopec@epfl.ch> | 2009-11-10 22:37:47 +0000 |
commit | ecee4b18ad1496254c87538149eaeb7f10a8b33c (patch) | |
tree | 5dfed47e9f3289ca049aec47165faf21aa934677 | |
parent | 2a5669288a27478a2b505ed79e0022432d6955a3 (diff) | |
download | scala-ecee4b18ad1496254c87538149eaeb7f10a8b33c.tar.gz scala-ecee4b18ad1496254c87538149eaeb7f10a8b33c.tar.bz2 scala-ecee4b18ad1496254c87538149eaeb7f10a8b33c.zip |
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.
-rw-r--r-- | src/library/scala/collection/mutable/LinkedList.scala | 6 |
1 files changed, 4 insertions, 2 deletions
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 |