BitTree.union_bits: def of mylsm-lsm-store@0.6.0.1 Import: import mylsm-lsm-store@0.6.0.1/src/BitTree.bend as BitTree Lines 199-221 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=199&end_line=221 import Base # Word-wise union for chunked Bloom builds. Both sides always share the exact # shape (same height from the same bit count); mismatched arms are unreachable # by construction and keep the Fork side. def union_bits(ta: WordTree, tb: WordTree) -> WordTree: match ta tb: case Empty{} Empty{}: Empty{} case Empty{} Leaf{wb}: Leaf{wb} case Empty{} Fork{lb, rb}: Fork{lb, rb} case Leaf{wa} Empty{}: Leaf{wa} case Leaf{wa} Leaf{wb}: Leaf{U32.or(wa, wb)} case Leaf{wa} Fork{lb, rb}: Fork{lb, rb} case Fork{la, ra} Empty{}: Fork{la, ra} case Fork{la, ra} Leaf{wb}: Fork{la, ra} case Fork{la, ra} Fork{lb, rb}: Fork{union_bits(la, lb), union_bits(ra, rb)} Uses (2): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.or https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/BitTree.bend&name=WordTree