Swpick.select_next: def of cswap-bend-cli@0.1.0.0 Import: import cswap-bend-cli@0.1.0.0/swpick.bend as Swpick Lines 55-62 of cswap-bend-cli@0.1.0.0/swpick.bend: https://jend.leeeet.dev/read.txt?path=cswap-bend-cli@0.1.0.0/swpick.bend&start_line=55&end_line=62 import Base # Walk `cs` (already in rotation order, current slot excluded) as switch() does. # `avail` is next-available: skip accounts with no headroom. def select_next(+cs: List<&2, Cand>, +avail: Bool) -> Sel: match cs: case Nil{}: SelNone{[], False{}} case Con{c, rest}: sel_step(avail, c, select_next(rest, avail)) Uses (5): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/swpick.bend&name=Cand https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/swpick.bend&name=Sel https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/swpick.bend&name=sel_step