def ordered.strict.go

mylsm-lsm-store@0.6.0.1 · src/ByteMemTable.bend:533

import mylsm-lsm-store@0.6.0.1/src/ByteMemTable.bend as ByteMemTable
import Base
import mylsm-lsm-store@0.6.0.1/src/Keys.bend as Keys

533# Checks strict key order with fuel derived from the number of entries.
534def ordered.strict.go(fuel: Nat, entries: List<&1, Entry>) -> Bool:
535  match fuel:
536    case 0n:
537      True{}
538    case 1n+rest:
539      match entries:
540        case Nil{}:
541          True{}
542        case Con{_, Nil{}}:
543          True{}
544        case Con{Entry{first, _}, Con{Entry{second, _}, tail}}:
545          +tail_valid = ordered.strict.go(rest, tail)
546          Bool.and(ordered.strict.order(Keys.Bytes.cmp.with_inputs(first, second)), tail_valid)

Uses (7)

Used by (1)