ByteMemTable.retained.go: def of mylsm-lsm-store@0.6.0.1 Import: import mylsm-lsm-store@0.6.0.1/src/ByteMemTable.bend as ByteMemTable Lines 463-469 of mylsm-lsm-store@0.6.0.1/src/ByteMemTable.bend: https://jend.leeeet.dev/read.txt?path=mylsm-lsm-store@0.6.0.1/src/ByteMemTable.bend&start_line=463&end_line=469 import Base import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes # Adds a fixed per-entry estimate to encoded payload bytes for retention limits. def retained.go(entries: List<&1, Entry>, total: Nat) -> Nat: match entries: case Nil{}: total case Con{Entry{Bytes.Bytes{+len, _}, val}, tail}: retained.go(tail, Nat.add(Nat.add(Nat.add(total, 32n), U32.to_nat(len)), payload.value(val))) Uses (7): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=bend-kit-bytes@0.3.3.0/bytes.bend&name=Bytes https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/ByteMemTable.bend&name=Entry https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/ByteMemTable.bend&name=payload.value