Skip to content

Commit

Permalink
chore(race): remove specified generic type (#197) [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
hoc081098 authored Nov 12, 2023
1 parent 2098080 commit 12355ce
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/commonMain/kotlin/com/hoc081098/flowext/race.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
package com.hoc081098.flowext

import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.channels.ChannelResult
import kotlinx.coroutines.channels.onFailure
import kotlinx.coroutines.channels.onSuccess
import kotlinx.coroutines.channels.produce
Expand Down Expand Up @@ -100,7 +99,7 @@ public fun <T> race(flows: Iterable<Flow<T>>): Flow<T> = flow {
.singleOrNull()
?.let { return@coroutineScope emitAll(it) }

val (winnerIndex, winnerResult) = select<Pair<Int, ChannelResult<T>>> {
val (winnerIndex, winnerResult) = select {
channels.forEachIndexed { index, channel ->
channel.onReceiveCatching {
index to it
Expand Down

0 comments on commit 12355ce

Please sign in to comment.