diff options
author | Martin Odersky <odersky@gmail.com> | 2012-08-17 17:31:58 +0200 |
---|---|---|
committer | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2012-08-20 08:11:09 +0100 |
commit | 80ba5784586c11bb5d3ec2d7330eef8564f13e8b (patch) | |
tree | 56d5cbb82b9021abe4e2937b0b1b3e26da4a0e14 | |
parent | 82c61687d82deef42f317f8e26f89382bba2c6fa (diff) | |
download | scala-80ba5784586c11bb5d3ec2d7330eef8564f13e8b.tar.gz scala-80ba5784586c11bb5d3ec2d7330eef8564f13e8b.tar.bz2 scala-80ba5784586c11bb5d3ec2d7330eef8564f13e8b.zip |
Reverted addition of 5 specialized method from LinearSeqOptimized to List.
It seems any gains were more then compensated by the loss of making map polymorphic, probably preventing inlining decisions in Hotspot.
-rw-r--r-- | src/library/scala/collection/immutable/List.scala | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/src/library/scala/collection/immutable/List.scala b/src/library/scala/collection/immutable/List.scala index d9e98b56c1..87b58005cf 100644 --- a/src/library/scala/collection/immutable/List.scala +++ b/src/library/scala/collection/immutable/List.scala @@ -310,62 +310,6 @@ sealed abstract class List[+A] extends AbstractSeq[A] these = these.tail } } - - @inline override /*TraversableLike*/ - def map[B, That](f: A => B)(implicit bf: CanBuildFrom[List[A], B, That]): That = { - val b = bf(repr) - var these = this - while (!these.isEmpty) { - b += f(these.head) - these = these.tail - } - b.result - } - - @inline override /*TraversableLike*/ - def flatMap[B, That](f: A => GenTraversableOnce[B])(implicit bf: CanBuildFrom[List[A], B, That]): That = { - val b = bf(repr) - var these = this - while (!these.isEmpty) { - b ++= f(these.head).seq - these = these.tail - } - b.result - } - - @inline override /*TraversableLike*/ - def filter(p: A => Boolean): List[A] = { - val b = newBuilder - var these = this - while (!these.isEmpty) { - val x = these.head - if (p(x)) b += x - these = these.tail - } - b.result - } - - @inline override /*TraversableLike*/ - def filterNot(p: A => Boolean): List[A] = { - val b = newBuilder - var these = this - while (!these.isEmpty) { - val x = these.head - if (!p(x)) b += x - these = these.tail - } - b.result - } - - @inline override /*SeqLike*/ - def contains(elem: Any): Boolean = { - var these = this - while (!these.isEmpty) { - if (these.head == elem) return true - these = these.tail - } - false - } @deprecated("use `distinct` instead", "2.8.0") def removeDuplicates: List[A] = distinct |