def bsearch.array.pick

bend-osdev-algo@0.1.0.0 · bsearch.bend:84

import bend-osdev-algo@0.1.0.0/bsearch.bend as Bsearch
import Base

84# one halving of [lo, hi): the element at mid decides which half stays
85def bsearch.array.pick(below: Bool, a: Array<U32>, +lo: U32, +hi: U32, +mid: U32) -> BsearchState:
86  match below:
87    case True{}:
88      BsearchState{a, U32.inc(mid), hi}
89    case False{}:
90      BsearchState{a, lo, mid}

Uses (5)

Used by (2)