Skip to content

Commit d69c279

Browse files
author
Martijn Hoekstra
committed
use m.Builder over plain Builder
1 parent e994c89 commit d69c279

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

compat/src/main/scala-2.11_2.12/scala/collection/compat/CompatImpl.scala

+5-6
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,13 @@ package scala.collection.compat
1414

1515
import scala.reflect.ClassTag
1616
import scala.collection.generic.CanBuildFrom
17-
import scala.collection.mutable.Builder
1817
import scala.collection.{immutable => i, mutable => m}
1918

2019
/* builder optimized for a single ++= call, which returns identity on result if possible
2120
* and defers to the underlying builder if not.
2221
*/
23-
private final class IdentityPreservingBuilder[A, CC[X] <: TraversableOnce[X]](that: Builder[A, CC[A]])(implicit ct: ClassTag[CC[A]])
24-
extends Builder[A, CC[A]] {
22+
private final class IdentityPreservingBuilder[A, CC[X] <: TraversableOnce[X]](that: m.Builder[A, CC[A]])(implicit ct: ClassTag[CC[A]])
23+
extends m.Builder[A, CC[A]] {
2524

2625
//invariant: ruined => (collection == null)
2726
var collection: CC[A] = null.asInstanceOf[CC[A]]
@@ -62,9 +61,9 @@ private final class IdentityPreservingBuilder[A, CC[X] <: TraversableOnce[X]](th
6261
}
6362

6463
private[compat] object CompatImpl {
65-
def simpleCBF[A, C](f: => Builder[A, C]): CanBuildFrom[Any, A, C] = new CanBuildFrom[Any, A, C] {
66-
def apply(from: Any): Builder[A, C] = apply()
67-
def apply(): Builder[A, C] = f
64+
def simpleCBF[A, C](f: => m.Builder[A, C]): CanBuildFrom[Any, A, C] = new CanBuildFrom[Any, A, C] {
65+
def apply(from: Any): m.Builder[A, C] = apply()
66+
def apply(): m.Builder[A, C] = f
6867
}
6968

7069
type ImmutableBitSetCC[X] = ({ type L[_] = i.BitSet })#L[X]

0 commit comments

Comments
 (0)