summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorcremet <cremet@epfl.ch>2003-12-08 16:07:06 +0000
committercremet <cremet@epfl.ch>2003-12-08 16:07:06 +0000
commit103888d458fe8cc0ba7c8000c9e2b66923a1b430 (patch)
tree2f06583d1c94a4b7ff10837011402a507d401944 /sources
parent6cc72548056de15e53c381fc59a6545fa8789331 (diff)
downloadscala-103888d458fe8cc0ba7c8000c9e2b66923a1b430.tar.gz
scala-103888d458fe8cc0ba7c8000c9e2b66923a1b430.tar.bz2
scala-103888d458fe8cc0ba7c8000c9e2b66923a1b430.zip
- modified replicate.
Diffstat (limited to 'sources')
-rw-r--r--sources/scala/concurrent/ops.scala9
1 files changed, 5 insertions, 4 deletions
diff --git a/sources/scala/concurrent/ops.scala b/sources/scala/concurrent/ops.scala
index 12701ef9ea..554cf78021 100644
--- a/sources/scala/concurrent/ops.scala
+++ b/sources/scala/concurrent/ops.scala
@@ -19,11 +19,12 @@ object ops {
Pair(xp, y.get)
}
- def replicate(start: Int, end: Int)(def p: Int => Unit): Unit = {
- if (start == end) {
- } else if (start + 1 == end) {
+ def replicate(start: Int, end: Int)(p: Int => Unit): Unit = {
+ if (start == end)
+ ()
+ else if (start + 1 == end)
p(start)
- } else {
+ else {
val mid = (start + end) / 2;
spawn { replicate(start, mid)(p) }
replicate(mid, end)(p)