def decide.current

mylsm-lsm-store@0.6.0.1 · src/scan/ByteBlockBuilder.bend:17

import mylsm-lsm-store@0.6.0.1/src/scan/ByteBlockBuilder.bend as ByteBlockBuilder
import Base

17# Chooses whether a record fits the current block without exceeding its cap.
18def decide.current(
19  used_bytes: Nat,
20  record_bytes: Nat,
21  fits_current: Bool
22) -> Decision:
23  match fits_current:
24    case True{}: Append{Nat.add(used_bytes, record_bytes)}
25    case False{}:
26      decide.rollover(record_bytes, Nat.is_eq(used_bytes, 0n))

Uses (6)

Used by (1)