Skip to content

Commit 9870f56

Browse files
committed
[nomerge] Reuse tasksupport in CombinerFactory
Reported in scala-parallel-collections 152.
1 parent 30edcc3 commit 9870f56

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

library/src/scala/collection/parallel/ParIterableLike.scala

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,11 @@ self: ParIterableLike[T, Repr, Sequential] =>
574574
def apply() = shared
575575
def doesShareCombiners = true
576576
} else new CombinerFactory[T, Repr] {
577-
def apply() = newCombiner
577+
def apply() = {
578+
val r = newCombiner
579+
r.combinerTaskSupport = tasksupport
580+
r
581+
}
578582
def doesShareCombiners = false
579583
}
580584
}
@@ -587,7 +591,11 @@ self: ParIterableLike[T, Repr, Sequential] =>
587591
def apply() = shared
588592
def doesShareCombiners = true
589593
} else new CombinerFactory[S, That] {
590-
def apply() = cbf()
594+
def apply() = {
595+
val r = cbf()
596+
r.combinerTaskSupport = tasksupport
597+
r
598+
}
591599
def doesShareCombiners = false
592600
}
593601
}

0 commit comments

Comments
 (0)