mirror of
https://github.com/odin-lang/Odin.git
synced 2026-04-19 21:10:30 +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 {
|
||||
if can_send(c) {
|
||||
if i > builtin.len(send_msgs)-1 || send_msgs[i] == nil {
|
||||
continue
|
||||
}
|
||||
if can_send(c) {
|
||||
candidates[count] = {
|
||||
is_recv = false,
|
||||
idx = i,
|
||||
|
||||
Reference in New Issue
Block a user