aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJack Mordaunt <jackmordaunt.dev@gmail.com>2025-06-05 15:27:24 -0300
committerJack Mordaunt <jackmordaunt.dev@gmail.com>2025-06-12 16:14:51 -0300
commit7f9589922db4f2006287c1e3fc11e5ab308b9de3 (patch)
tree76485dd90874b379781a92cdf63c4b44fbb8a061 /src
parent0ed6cdc98eead010b448a10ac2c45d2695563be9 (diff)
core/sync.select_raw: return a useful index
This fixes a flaw in the original implementation: the returned index is actually useless to the caller. This is because the index returned refers to the internal "candidate" list. This list is dynamic, and may not have all of the input channels (if they weren't ready according to chan.can_{recv,send}). That means the index is not guaranteed to mean anything to the caller. The fix introduced here is to return the index into the input slice (recvs,sends) and an enum to specify which input slice that is. If no selection was made, then (-1, .None) is returned to communicate as much. Signed-off-by: Jack Mordaunt <jackmordaunt.dev@gmail.com>
Diffstat (limited to 'src')
0 files changed, 0 insertions, 0 deletions