File tree 2 files changed +4
-4
lines changed
kotlinx-coroutines-core/common/src/channels
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -494,7 +494,7 @@ internal abstract class AbstractChannel<E>(
494
494
// Too late, already cancelled, but we removed it from the queue and need to notify on undelivered element.
495
495
// The only exception is when this "send" operation is an `onSend` clause that has to be re-registered
496
496
// in the corresponding `select` invocation.
497
- if (send ! is SendElementSelectWithUndeliveredHandler <* > || send.trySelectResult != REREGISTER )
497
+ if (! ( send is SendElementSelectWithUndeliveredHandler <* > && send.trySelectResult == REREGISTER ) )
498
498
send.undeliveredElement()
499
499
}
500
500
}
Original file line number Diff line number Diff line change @@ -158,9 +158,9 @@ internal open class ArrayChannel<E>(
158
158
// Too late, already cancelled, but we removed it from the queue and need to notify on undelivered element.
159
159
// The only exception is when this "send" operation is an `onSend` clause that has to be re-registered
160
160
// in the corresponding `select` invocation.
161
- val send = send
162
- if (send ! is SendElementSelectWithUndeliveredHandler <* > || send.trySelectResult != REREGISTER )
163
- send!! .undeliveredElement()
161
+ val send = send!!
162
+ if (! ( send is SendElementSelectWithUndeliveredHandler <* > && send.trySelectResult == REREGISTER ) )
163
+ send.undeliveredElement()
164
164
}
165
165
}
166
166
if (replacement != = POLL_FAILED && replacement !is Closed <* >) {
You can’t perform that action at this time.
0 commit comments