BitTree.set_if: def of mylsm-lsm-store@0.6.0.1 Import: import mylsm-lsm-store@0.6.0.1/src/BitTree.bend as BitTree Lines 172-180 of mylsm-lsm-store@0.6.0.1/src/BitTree.bend: https://jend.leeeet.dev/read.txt?path=mylsm-lsm-store@0.6.0.1/src/BitTree.bend&start_line=172&end_line=180 import Base import 0x9ee2e9a299991dcc089fe22c7f3ceb5f/src/containers/bitset.bend as BitWords # Update if for the packed bit-tree operations. def set_if(inside: Bool, +tree: BitTree, +bit: Nat) -> BitTree: match inside: case False{}: tree case True{}: +index = Nat.div(bit, 32n) +old = word_at(tree, index) replace_word(tree, index, BitWords.word_put(True{}, old, Nat.mod(bit, 32n))) Uses (7): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.div https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.mod https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/BitTree.bend&name=BitTree https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/BitTree.bend&name=replace_word https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/BitTree.bend&name=word_at