diff options
author | Aleksandar Pokopec <aleksandar.prokopec@epfl.ch> | 2010-08-31 09:11:31 +0000 |
---|---|---|
committer | Aleksandar Pokopec <aleksandar.prokopec@epfl.ch> | 2010-08-31 09:11:31 +0000 |
commit | 4af85c28c4d3e1bf57f773fe7feb7c03d6afe052 (patch) | |
tree | 19166bd497a0363a94b4b41eebd50aa8e401994e /src | |
parent | 185d04643d258d098752c3d0a27c4d95b294acb2 (diff) | |
download | scala-4af85c28c4d3e1bf57f773fe7feb7c03d6afe052.tar.gz scala-4af85c28c4d3e1bf57f773fe7feb7c03d6afe052.tar.bz2 scala-4af85c28c4d3e1bf57f773fe7feb7c03d6afe052.zip |
Added a few overrides to prevent default implem...
Added a few overrides to prevent default implementation that uses
'foreach'.
Fixes #3747. Closes #3747. No review.
Diffstat (limited to 'src')
-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 |