SortedRun.partition_step: def of mylsm-lsm-store@0.6.0.1 Import: import mylsm-lsm-store@0.6.0.1/src/SortedRun.bend as SortedRun Lines 353-368 of mylsm-lsm-store@0.6.0.1/src/SortedRun.bend: https://jend.leeeet.dev/read.txt?path=mylsm-lsm-store@0.6.0.1/src/SortedRun.bend&start_line=353&end_line=368 import Base import mylsm-lsm-store@0.6.0.1/src/MemTable.bend as MemTable # Partition step for the sorted-run operations. def partition_step( full: Bool, target: Nat, room_after: Nat, entry: MemTable.Entry, rest: List<&2, MemTable.Entry>, current_rev: List<&2, MemTable.Entry>, chunks_rev: List<&2, List<&2, MemTable.Entry>> ) -> PartitionState: match full: case False{}: PartitionState{room_after, rest, Con{entry, current_rev}, chunks_rev} case True{}: chunk = List.reverse(&2, MemTable.Entry, Con{entry, current_rev}) PartitionState{target, rest, Nil{}, Con{chunk, chunks_rev}} Uses (6): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.reverse https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/MemTable.bend&name=Entry https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/SortedRun.bend&name=PartitionState