Merge branch 'develop' of https://github.com/vector-im/element-x-android-poc into develop
This commit is contained in:
@@ -4,6 +4,7 @@ import kotlinx.coroutines.async
|
||||
import kotlinx.coroutines.awaitAll
|
||||
import kotlinx.coroutines.coroutineScope
|
||||
|
||||
// https://jivimberg.io/blog/2018/05/04/parallel-map-in-kotlin/
|
||||
suspend fun <A, B> Iterable<A>.parallelMap(f: suspend (A) -> B): List<B> = coroutineScope {
|
||||
map { async { f(it) } }.awaitAll()
|
||||
}
|
||||
Reference in New Issue
Block a user