def peq_get

bend-edit-distance@0.2.2.0 · src/Myers.bend:60

import bend-edit-distance@0.2.2.0/src/Myers.bend as Myers
import Base

60def peq_get(table: Peq, +code: U32, bit: Bool) -> U32:
61  match table bit:
62    case Mask{bits} _:
63      bits
64    case Branch{low, high} True{}:
65      +next = U32.shr(code)
66      peq_get(high, next, U32.is_ne(U32.and(next, 1), 0))
67    case Branch{low, high} False{}:
68      +next = U32.shr(code)
69      peq_get(low, next, U32.is_ne(U32.and(next, 1), 0))

Uses (6)

Used by (4)