def payload.go
import mylsm-lsm-store@0.6.0.1/src/ByteMemTable.bend as ByteMemTableimport Base
import bend-kit-bytes@0.3.2.0/bytes.bend as Bytes
449# Sums key and present-value byte lengths over the mutation log.
450def payload.go(entries: List<&1, Entry>, total: Nat) -> Nat:
451 match entries:
452 case Nil{}:
453 total
454 case Con{Entry{Bytes.Bytes{+len, _}, val}, tail}:
455 payload.go(tail, Nat.add(Nat.add(total, U32.to_nat(len)), payload.value(val)))