summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksandar Pokopec <aleksandar.prokopec@epfl.ch>2009-11-10 22:37:47 +0000
committerAleksandar Pokopec <aleksandar.prokopec@epfl.ch>2009-11-10 22:37:47 +0000
commitecee4b18ad1496254c87538149eaeb7f10a8b33c (patch)
tree5dfed47e9f3289ca049aec47165faf21aa934677 /src
parent2a5669288a27478a2b505ed79e0022432d6955a3 (diff)
downloadscala-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.
Diffstat (limited to 'src')
-rw-r--r--src/library/scala/collection/mutable/LinkedList.scala6
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