def replace_word_if
import mylsm-lsm-store@0.6.0.1/src/BitTree.bend as BitTreeimport Base
157# Replace word if for the packed bit-tree operations.
158def replace_word_if(inside: Bool, tree: BitTree, index: Nat, value: U32) -> BitTree:
159 match inside:
160 case False{}:
161 tree
162 case True{}:
163 match tree:
164 case BT{root, words, capacity, +height}:
165 BT{tree_set_word(index_path(height, index, Nil{}), value, root), words, capacity, height}