Skip to content

Commit 8e13241

Browse files
author
Sergey Mashkov
committed
IO: eliminate unnecessary resume at close+flush
we can do that because close do better resume suspensions later
1 parent e4d3ce7 commit 8e13241

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/kotlinx-coroutines-io/src/main/kotlin/kotlinx/coroutines/experimental/io/ByteBufferChannel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ internal class ByteBufferChannel(
6969
if (closed != null) return false
7070
val newClosed = if (cause == null) ClosedElement.EmptyCause else ClosedElement(cause)
7171
if (!Closed.compareAndSet(this, null, newClosed)) return false
72-
flush()
72+
state.capacity.flush()
7373
if (state.capacity.isEmpty() || cause != null) tryTerminate()
7474
resumeClosed(cause)
7575
return true

0 commit comments

Comments
 (0)