Skip to content

Commit fb762ce

Browse files
committed
use expression method
1 parent 1395c4e commit fb762ce

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

core/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/channels/ConflatedBroadcastChannelNotifyStressTest.kt

+6-6
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ class ConflatedBroadcastChannelNotifyStressTest : TestBase() {
9393
assertThat(sentTotal.get(), IsEqual(nEvents))
9494
}
9595

96-
suspend fun waitForEvent(): Int {
97-
val sub = broadcast.openSubscription()
98-
val value = sub.receive()
99-
sub.cancel()
100-
return value
101-
}
96+
suspend fun waitForEvent(): Int =
97+
with(broadcast.openSubscription()) {
98+
val value = receive()
99+
cancel()
100+
value
101+
}
102102
}

0 commit comments

Comments
 (0)