From 54b26beb2c9a82fc5a1b3a66f11ed763bfad39be Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Mon, 4 Jul 2011 04:55:04 +0000 Subject: 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. --- src/library/scala/collection/immutable/List.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/library/scala/collection/immutable/List.scala') diff --git a/src/library/scala/collection/immutable/List.scala b/src/library/scala/collection/immutable/List.scala index 563f14eac6..1781e7ba36 100644 --- a/src/library/scala/collection/immutable/List.scala +++ b/src/library/scala/collection/immutable/List.scala @@ -426,7 +426,8 @@ object List extends SeqFactory[List] { import scala.collection.{Iterable, Seq, IndexedSeq} /** $genericCanBuildFromInfo */ - implicit def canBuildFrom[A]: CanBuildFrom[Coll, A, List[A]] = new GenericCanBuildFrom[A] + implicit def canBuildFrom[A]: CanBuildFrom[Coll, A, List[A]] = + ReusableCBF.asInstanceOf[GenericCanBuildFrom[A]] def newBuilder[A]: Builder[A, List[A]] = new ListBuffer[A] -- cgit v1.2.3