We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
BufferedChannel.expandBuffer()
1 parent a027d68 commit 6165533Copy full SHA for 6165533
kotlinx-coroutines-core/common/src/channels/BufferedChannel.kt
@@ -1220,9 +1220,9 @@ internal open class BufferedChannel<E>(
1220
incCompletedExpandBufferAttempts()
1221
return
1222
}
1223
- // Is `bufferEndSegment` outdated?
+ // Is `bufferEndSegment` outdated or is the segment with the required id already removed?
1224
// Find the required segment, creating new ones if needed.
1225
- if (segment.id < id) {
+ if (segment.id != id) {
1226
segment = findSegmentBufferEnd(id, segment, b)
1227
// Restart if the required segment is removed, or
1228
// the linked list of segments is already closed,
0 commit comments