diff options
author | Vadim Mishenev <vad-mishenev@yandex.ru> | 2022-08-29 13:27:43 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-29 13:27:43 +0300 |
commit | e68eea63f2affbacf69af041252bad4444fc812f (patch) | |
tree | 4acdb606b02d55a738690ff9796386da274fdef2 /core/src/main/kotlin/utilities/parallelCollectionOperations.kt | |
parent | 34a8ae166e7220ddf8c3c42fab466234623501e7 (diff) | |
download | dokka-e68eea63f2affbacf69af041252bad4444fc812f.tar.gz dokka-e68eea63f2affbacf69af041252bad4444fc812f.tar.bz2 dokka-e68eea63f2affbacf69af041252bad4444fc812f.zip |
Display inherited extensions (#2625)
Diffstat (limited to 'core/src/main/kotlin/utilities/parallelCollectionOperations.kt')
-rw-r--r-- | core/src/main/kotlin/utilities/parallelCollectionOperations.kt | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/core/src/main/kotlin/utilities/parallelCollectionOperations.kt b/core/src/main/kotlin/utilities/parallelCollectionOperations.kt index b3191e8b..35ad48fd 100644 --- a/core/src/main/kotlin/utilities/parallelCollectionOperations.kt +++ b/core/src/main/kotlin/utilities/parallelCollectionOperations.kt @@ -1,8 +1,6 @@ package org.jetbrains.dokka.utilities -import kotlinx.coroutines.async -import kotlinx.coroutines.awaitAll -import kotlinx.coroutines.coroutineScope +import kotlinx.coroutines.* suspend inline fun <A, B> Iterable<A>.parallelMap(crossinline f: suspend (A) -> B): List<B> = coroutineScope { map { async { f(it) } }.awaitAll() @@ -13,5 +11,5 @@ suspend inline fun <A, B> Iterable<A>.parallelMapNotNull(crossinline f: suspend } suspend inline fun <A> Iterable<A>.parallelForEach(crossinline f: suspend (A) -> Unit): Unit = coroutineScope { - map { async { f(it) } }.awaitAll() + forEach { launch { f(it) } } } |