Skip to content

Commit

Permalink
Fix ctx inconsistency (#2956)
Browse files Browse the repository at this point in the history
  • Loading branch information
nomisRev authored Mar 3, 2023
1 parent f6c8324 commit f110e6f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import kotlin.coroutines.CoroutineContext
import kotlin.coroutines.EmptyCoroutineContext

public suspend fun <A, B> Iterable<A>.parMap(
ctx: CoroutineContext = EmptyCoroutineContext,
context: CoroutineContext = EmptyCoroutineContext,
concurrency: Int,
f: suspend CoroutineScope.(A) -> B
): List<B> {
val semaphore = Semaphore(concurrency)
return parMap(ctx) {
return parMap(context) {
semaphore.withPermit { f(it) }
}
}
Expand Down

0 comments on commit f110e6f

Please sign in to comment.