def total.copies
mylsm-lsm-store@0.6.0.1 · src/SstReadPolicy.bend:30
import mylsm-lsm-store@0.6.0.1/src/SstReadPolicy.bend as SstReadPolicy
import Base
30def total.copies(
31 totals: Nat & Nat,
32 sizes: Nat & Nat,
33 max_bytes: Nat
34) -> TotalDecision:
35 match totals:
36 case (checked_total, next_total):
37 match sizes:
38 case (checked_size, next_size):
39 Bool.pick(TotalDecision,
40 Nat.is_le(Nat.add(checked_total, checked_size), max_bytes),
41 TotalAdmitted{Nat.add(next_total, next_size)}, TotalRejected{})