def select_next

cswap-bend-cli@0.1.0.0 · swpick.bend:55

import cswap-bend-cli@0.1.0.0/swpick.bend as Swpick
import Base

55# Walk `cs` (already in rotation order, current slot excluded) as switch() does.
56# `avail` is next-available: skip accounts with no headroom.
57def select_next(+cs: List<&2, Cand>, +avail: Bool) -> Sel:
58  match cs:
59    case Nil{}:
60      SelNone{[], False{}}
61    case Con{c, rest}:
62      sel_step(avail, c, select_next(rest, avail))

Uses (5)

Used by (2)