summaryrefslogtreecommitdiff
path: root/src/library/scala/collection/immutable/Queue.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-07-04 04:55:04 +0000
committerPaul Phillips <paulp@improving.org>2011-07-04 04:55:04 +0000
commit54b26beb2c9a82fc5a1b3a66f11ed763bfad39be (patch)
tree111a2081507c084b81918216cdfdaf185605961a /src/library/scala/collection/immutable/Queue.scala
parent69b9d9858e6127d021e083d336e9629c12173698 (diff)
downloadscala-54b26beb2c9a82fc5a1b3a66f11ed763bfad39be.tar.gz
scala-54b26beb2c9a82fc5a1b3a66f11ed763bfad39be.tar.bz2
scala-54b26beb2c9a82fc5a1b3a66f11ed763bfad39be.zip
Discovered another impressive source of unneces...
Discovered another impressive source of unnecessary garbage is every collection creating a new GenericCanBuildFrom for every map ever performed. They can all use the same one: they all have the same implementation. It looks like tiark had already figured this out and done it for Vector: I followed with the other fifty. I really haven't the least idea who to have review most things. No review.
Diffstat (limited to 'src/library/scala/collection/immutable/Queue.scala')
-rw-r--r--src/library/scala/collection/immutable/Queue.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/library/scala/collection/immutable/Queue.scala b/src/library/scala/collection/immutable/Queue.scala
index bf5dc6816a..e09e4b7196 100644
--- a/src/library/scala/collection/immutable/Queue.scala
+++ b/src/library/scala/collection/immutable/Queue.scala
@@ -144,7 +144,7 @@ class Queue[+A] protected(protected val in: List[A], protected val out: List[A])
*/
object Queue extends SeqFactory[Queue] {
/** $genericCanBuildFromInfo */
- implicit def canBuildFrom[A]: CanBuildFrom[Coll, A, Queue[A]] = new GenericCanBuildFrom[A]
+ implicit def canBuildFrom[A]: CanBuildFrom[Coll, A, Queue[A]] = ReusableCBF.asInstanceOf[GenericCanBuildFrom[A]]
def newBuilder[A]: Builder[A, Queue[A]] = new ListBuffer[A] mapResult (x => new Queue[A](Nil, x.toList))
override def empty[A]: Queue[A] = EmptyQueue.asInstanceOf[Queue[A]]
override def apply[A](xs: A*): Queue[A] = new Queue[A](Nil, xs.toList)