diff options
-rw-r--r-- | src/library/scala/collection/parallel/ParIterableLike.scala | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/library/scala/collection/parallel/ParIterableLike.scala b/src/library/scala/collection/parallel/ParIterableLike.scala index c6130aeb12..baff4de36a 100644 --- a/src/library/scala/collection/parallel/ParIterableLike.scala +++ b/src/library/scala/collection/parallel/ParIterableLike.scala @@ -286,6 +286,10 @@ extends IterableLike[T, Repr] */ def reduceOption[U >: T](op: (U, U) => U): Option[U] = if (isEmpty) None else Some(reduce(op)) + override def reduceLeft[U >: T](op: (U, T) => U): U = iterator.reduceLeft(op) + + override def reduceRight[U >: T](op: (T, U) => U): U = iterator.reduceRight(op) + /** Folds the elements of this sequence using the specified associative binary operator. * The order in which the elements are reduced is unspecified and may be nondeterministic. * @@ -305,6 +309,10 @@ extends IterableLike[T, Repr] executeAndWaitResult(new Fold(z, op, parallelIterator)) } + override def foldLeft[S](z: S)(op: (S, T) => S): S = iterator.foldLeft(z)(op) + + override def foldRight[S](z: S)(op: (T, S) => S): S = iterator.foldRight(z)(op) + /** Aggregates the results of applying an operator to subsequent elements. * * This is a more general form of `fold` and `reduce`. It has similar semantics, but does |