Skip to content

Commit 841ae1b

Browse files
committed
Merge remote-tracking branch 'origin/master' into develop
2 parents ee8bbfc + 28e3d05 commit 841ae1b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/composing-suspending-functions.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ scope and that is what [coroutineScope] function provides:
332332
suspend fun concurrentSum(): Int = coroutineScope {
333333
val one = async { doSomethingUsefulOne() }
334334
val two = async { doSomethingUsefulTwo() }
335-
one.await() + two.await()
335+
one.await() + two.await()
336336
}
337337
```
338338

@@ -350,18 +350,18 @@ import kotlinx.coroutines.*
350350
import kotlin.system.*
351351

352352
fun main() = runBlocking<Unit> {
353-
//sampleStart
353+
//sampleStart
354354
val time = measureTimeMillis {
355355
println("The answer is ${concurrentSum()}")
356356
}
357357
println("Completed in $time ms")
358-
//sampleEnd
358+
//sampleEnd
359359
}
360360

361361
suspend fun concurrentSum(): Int = coroutineScope {
362362
val one = async { doSomethingUsefulOne() }
363363
val two = async { doSomethingUsefulTwo() }
364-
one.await() + two.await()
364+
one.await() + two.await()
365365
}
366366

367367
suspend fun doSomethingUsefulOne(): Int {
@@ -418,7 +418,7 @@ suspend fun failedConcurrentSum(): Int = coroutineScope {
418418
println("Second child throws an exception")
419419
throw ArithmeticException()
420420
}
421-
one.await() + two.await()
421+
one.await() + two.await()
422422
}
423423
```
424424

0 commit comments

Comments
 (0)