def set_if

mylsm-lsm-store@0.3.2.0 · src/BitTree.bend:176

import mylsm-lsm-store@0.3.2.0/src/BitTree.bend as BitTree
import Base
import 0x9ee2e9a299991dcc089fe22c7f3ceb5f/src/containers/bitset.bend as BitWords

176def set_if(inside: Bool, +tree: BitTree, +bit: Nat) -> BitTree:
177  match inside:
178    case False{}:
179      tree
180    case True{}:
181      +index = Nat.div(bit, 32n)
182      +old = word_at(tree, index)
183      replace_word(tree, index, BitWords.word_put(True{}, old, Nat.mod(bit, 32n)))

Uses (7)

Used by (1)