mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
core/sync/chan.try_select_raw: skip nil input messages
This makes the proc easier and safer to call by letting the caller nil out messages to skip sends.
This commit is contained in:
@@ -1205,7 +1205,10 @@ try_select_raw :: proc "odin" (recvs: []^Raw_Chan, sends: []^Raw_Chan, send_msgs
|
|||||||
}
|
}
|
||||||
|
|
||||||
for c, i in sends {
|
for c, i in sends {
|
||||||
if can_send(c) {
|
if i > builtin.len(send_msgs)-1 || send_msgs[i] == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if can_send(c) {
|
||||||
candidates[count] = {
|
candidates[count] = {
|
||||||
is_recv = false,
|
is_recv = false,
|
||||||
idx = i,
|
idx = i,
|
||||||
|
|||||||
Reference in New Issue
Block a user