diff options
author | Aleksandar Pokopec <aleksandar.prokopec@epfl.ch> | 2011-01-07 12:05:21 +0000 |
---|---|---|
committer | Aleksandar Pokopec <aleksandar.prokopec@epfl.ch> | 2011-01-07 12:05:21 +0000 |
commit | 07edcee629fb00808fb695ba4ec68a26f3e99490 (patch) | |
tree | ccbdb23f2d9f1a03e7d637cc0f4876c3115414f5 /src/library | |
parent | 57ea3841d29a5c3d48eee68868780b19f1a49166 (diff) | |
download | scala-07edcee629fb00808fb695ba4ec68a26f3e99490.tar.gz scala-07edcee629fb00808fb695ba4ec68a26f3e99490.tar.bz2 scala-07edcee629fb00808fb695ba4ec68a26f3e99490.zip |
Changed foreach to pforeach.
No review.
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/collection/parallel/ParIterableLike.scala | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/library/scala/collection/parallel/ParIterableLike.scala b/src/library/scala/collection/parallel/ParIterableLike.scala index 2b2ebda2e2..3008f93ebd 100644 --- a/src/library/scala/collection/parallel/ParIterableLike.scala +++ b/src/library/scala/collection/parallel/ParIterableLike.scala @@ -383,17 +383,24 @@ self => executeAndWaitResult(new Aggregate(z, seqop, combop, parallelIterator)) } - /** Applies a function `f` to all the elements of the receiver. + /** Applies a function `f` to all the elements of $coll. * * $undefinedorder * * @tparam U the result type of the function applied to each element, which is always discarded - * @param f function that's applied to each element + * @param f function applied to each element */ - override def foreach[U](f: T => U): Unit = { + def pforeach[U](f: T => U): Unit = { executeAndWaitResult(new Foreach(f, parallelIterator)) } + /** Applies a function `f` to all the elements of $coll in a sequential order. + * + * @tparam U the result type of the function applied to each element, which is always discarded + * @param f function applied to each element + */ + override def foreach[U](f: T => U) = iterator.foreach(f) + override def count(p: T => Boolean): Int = { executeAndWaitResult(new Count(p, parallelIterator)) } |