summaryrefslogtreecommitdiff
path: root/src/library/scala/collection/immutable/List.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/library/scala/collection/immutable/List.scala')
-rw-r--r--src/library/scala/collection/immutable/List.scala1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/library/scala/collection/immutable/List.scala b/src/library/scala/collection/immutable/List.scala
index 5446b25888..563f14eac6 100644
--- a/src/library/scala/collection/immutable/List.scala
+++ b/src/library/scala/collection/immutable/List.scala
@@ -75,6 +75,7 @@ sealed abstract class List[+A] extends LinearSeq[A]
*/
def :::[B >: A](prefix: List[B]): List[B] =
if (isEmpty) prefix
+ else if (prefix.isEmpty) this
else (new ListBuffer[B] ++= prefix).prependToList(this)
/** Adds the elements of a given list in reverse order in front of this list.