summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)