File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
core/kotlinx-coroutines-core/src/main/kotlin/kotlinx/coroutines/experimental/channels Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change 16
16
17
17
package kotlinx.coroutines.experimental.channels
18
18
19
- import kotlinx.coroutines.experimental.Unconfined
20
- import kotlinx.coroutines.experimental.runBlocking
21
- import kotlin.coroutines.experimental.CoroutineContext
19
+ import kotlinx.coroutines.experimental.*
20
+ import kotlin.coroutines.experimental.*
22
21
23
22
internal const val DEFAULT_CLOSE_MESSAGE = " Channel was closed"
24
23
@@ -884,9 +883,7 @@ public suspend fun <E> ReceiveChannel<E>.toSet(): Set<E> =
884
883
public fun <E , R > ReceiveChannel<E>.flatMap (context : CoroutineContext = Unconfined , transform : suspend (E ) -> ReceiveChannel <R >): ReceiveChannel <R > =
885
884
produce(context) {
886
885
consumeEach {
887
- transform(it).consumeEach {
888
- send(it)
889
- }
886
+ transform(it).toChannel(this )
890
887
}
891
888
}
892
889
You can’t perform that action at this time.
0 commit comments