summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAleksandar Pokopec <aleksandar.prokopec@epfl.ch>2011-01-07 12:05:21 +0000
committerAleksandar Pokopec <aleksandar.prokopec@epfl.ch>2011-01-07 12:05:21 +0000
commit07edcee629fb00808fb695ba4ec68a26f3e99490 (patch)
treeccbdb23f2d9f1a03e7d637cc0f4876c3115414f5 /test
parent57ea3841d29a5c3d48eee68868780b19f1a49166 (diff)
downloadscala-07edcee629fb00808fb695ba4ec68a26f3e99490.tar.gz
scala-07edcee629fb00808fb695ba4ec68a26f3e99490.tar.bz2
scala-07edcee629fb00808fb695ba4ec68a26f3e99490.zip
Changed foreach to pforeach.
No review.
Diffstat (limited to 'test')
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/generic/ParallelBenches.scala12
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/hashtables/ParallelHashTableSets.scala4
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/hashtables/ParallelHashTables.scala4
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForeachHeavy.scala2
-rw-r--r--test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForeachLight.scala2
-rw-r--r--test/files/run/coder2/Coder2.scala2
6 files changed, 13 insertions, 13 deletions
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/generic/ParallelBenches.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/generic/ParallelBenches.scala
index e99c70d921..c0545aff52 100644
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/generic/ParallelBenches.scala
+++ b/test/benchmarks/src/scala/collection/parallel/benchmarks/generic/ParallelBenches.scala
@@ -144,7 +144,7 @@ self =>
extends SeqBench with SeqViewBench {
def comparisonMap = collection.Map("seqview" -> runseqview _)
def runseq = this.seqcoll.foreach(operators.eachFun)
- def runpar = this.parcoll.foreach(operators.eachFun)
+ def runpar = this.parcoll.pforeach(operators.eachFun)
def runseqview = {
this.seqview.foreach(operators.eachFun)
}
@@ -161,7 +161,7 @@ self =>
extends SeqBench with SeqViewBench {
def comparisonMap = collection.Map("seqview" -> runseqview _)
def runseq = this.seqcoll.slice(0, size / 2).foreach(operators.eachFun)
- def runpar = this.parcoll.slice(0, size / 2).foreach(operators.eachFun)
+ def runpar = this.parcoll.slice(0, size / 2).pforeach(operators.eachFun)
def runseqview = this.seqview.slice(0, size / 2).foreach(operators.eachFun)
def companion = IterationS
}
@@ -176,7 +176,7 @@ self =>
extends SeqBench with SeqViewBench {
def comparisonMap = collection.Map("seqview" -> runseqview _)
def runseq = this.seqcoll.map(operators.mapper).foreach(operators.eachFun)
- def runpar = this.parcoll.map(operators.mapper).foreach(operators.eachFun)
+ def runpar = this.parcoll.map(operators.mapper).pforeach(operators.eachFun)
def runseqview = this.seqview.map(operators.mapper).foreach(operators.eachFun)
def companion = IterationM
}
@@ -196,7 +196,7 @@ self =>
val withapp = this.seqcoll.++(sqappended)
withapp.foreach(operators.eachFun)
}
- def runpar = this.parcoll.++(appended).foreach(operators.eachFun)
+ def runpar = this.parcoll.++(appended).pforeach(operators.eachFun)
def runseqview = this.seqview.++(appended).foreach(operators.eachFun)
def companion = IterationA
}
@@ -215,7 +215,7 @@ self =>
val withzip = this.seqcoll.zip(zipped)
withzip.foreach(operators.eachPairFun)
}
- def runpar = this.parcoll.zip(zipped).foreach(operators.eachPairFun)
+ def runpar = this.parcoll.zip(zipped).pforeach(operators.eachPairFun)
def runseqview = this.seqview.zip(zipped).foreach(operators.eachPairFun)
def companion = IterationZ
}
@@ -235,7 +235,7 @@ self =>
val withpatch = this.seqcollAsSeq.patch(size / 4, sqpatch, size / 2)
withpatch.foreach(operators.eachFun)
}
- def runpar = this.parcoll.patch(size / 4, patch, size / 2).foreach(operators.eachFun)
+ def runpar = this.parcoll.patch(size / 4, patch, size / 2).pforeach(operators.eachFun)
def runseqview = this.seqview.patch(size / 4, patch, size / 2).foreach(operators.eachFun)
def companion = IterationP
}
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtables/ParallelHashTableSets.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtables/ParallelHashTableSets.scala
index 96d75f480f..88640f3644 100644
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtables/ParallelHashTableSets.scala
+++ b/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtables/ParallelHashTableSets.scala
@@ -91,7 +91,7 @@ trait ParHashTableSetBenches[T] extends StandardParIterableBenches[T, ParHashSet
extends IterableBench {
def comparisonMap = collection.Map()
def runseq = this.seqcoll.foreach(operators.foreachFun)
- def runpar = this.parcoll.foreach(operators.foreachFun)
+ def runpar = this.parcoll.pforeach(operators.foreachFun)
def companion = Foreach
}
@@ -115,7 +115,7 @@ object RefParHashTableSetBenches extends ParHashTableSetBenches[Dummy] {
val array = new Array[Int](size)
def comparisonMap = collection.Map()
def runseq = for (x <- this.seqcoll) array(x.in) += 1
- def runpar = for (x <- this.parcoll) array(x.in) += 1
+ def runpar = this.parcoll.pforeach { x => array(x.in) += 1 }
def companion = ForeachSet
override def onEnd {
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtables/ParallelHashTables.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtables/ParallelHashTables.scala
index 94c38b52b1..cf0e53e47d 100644
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtables/ParallelHashTables.scala
+++ b/test/benchmarks/src/scala/collection/parallel/benchmarks/hashtables/ParallelHashTables.scala
@@ -105,7 +105,7 @@ trait ParHashTableBenches[K, V] extends StandardParIterableBenches[(K, V), ParHa
extends IterableBench {
def comparisonMap = collection.Map()
def runseq = this.seqcoll.foreach(operators.foreachFun)
- def runpar = this.parcoll.foreach(operators.foreachFun)
+ def runpar = this.parcoll.pforeach(operators.foreachFun)
def companion = Foreach
}
@@ -131,7 +131,7 @@ object RefParHashTableBenches extends ParHashTableBenches[Dummy, Dummy] {
val array = new Array[Int](size)
def comparisonMap = collection.Map()
def runseq = for (p <- this.seqcoll) array(p._1.in) += 1
- def runpar = for (p <- this.parcoll) array(p._1.in) += 1
+ def runpar = this.parcoll.pforeach { p => array(p._1.in) += 1 }
def companion = ForeachSet
override def onEnd {
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForeachHeavy.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForeachHeavy.scala
index f151158ad9..4d7c48b0b4 100644
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForeachHeavy.scala
+++ b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForeachHeavy.scala
@@ -38,7 +38,7 @@ extends Resettable(sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont]) {
def companion = ForeachHeavy
override def repetitionsPerRun = 250
- def runpar = pa.foreach(ForeachHeavy.fun)
+ def runpar = pa.pforeach(ForeachHeavy.fun)
def runseq = sequentialForeach(ForeachHeavy.fun, sz)
def runjsr = jsrarr.apply(ForeachHeavy.funjsr)
def comparisonMap = collection.Map("jsr" -> runjsr _)
diff --git a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForeachLight.scala b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForeachLight.scala
index 79901148ac..5ef41d8d5b 100644
--- a/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForeachLight.scala
+++ b/test/benchmarks/src/scala/collection/parallel/benchmarks/parallel_array/ForeachLight.scala
@@ -19,7 +19,7 @@ class ForeachLight(sz: Int, p: Int, what: String)
extends Resettable(sz, p, what, new Cont(_), new Array[Any](_), classOf[Cont]) {
def companion = ForeachLight
- def runpar = pa.foreach(ForeachLight.fun)
+ def runpar = pa.pforeach(ForeachLight.fun)
def runseq = sequentialForeach(ForeachLight.fun, sz)
def runjsr = jsrarr.apply(ForeachLight.funjsr)
def comparisonMap = collection.Map("jsr" -> runjsr _)
diff --git a/test/files/run/coder2/Coder2.scala b/test/files/run/coder2/Coder2.scala
index a83044981b..7ecc5e67d1 100644
--- a/test/files/run/coder2/Coder2.scala
+++ b/test/files/run/coder2/Coder2.scala
@@ -163,7 +163,7 @@ class ParCoder(words: List[String]) {
/** Test code */
object Test {
- val code = "232843747294736262633"//837976"//"6477323986225453446"
+ val code = "2328437472947"//36262633"//837976"//"6477323986225453446"
//val code = "747294736262633"
/* */