def cmp

bend-kit-bytes@0.3.3.0 · bytes.bend:621

import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
import Base

621# Both buffers back, and their order byte by byte; a prefix sorts first.
622# The shorter buffer's bytes past its len are 0, so its last word compares low when only the longer one goes on.
623def cmp(a: Bytes, b: Bytes) -> Bytes & Bytes & Cmp:
624  Bytes{+la, xa} = a
625  Bytes{+lb, ya} = b
626  cmp.fin(la, lb, cmp.go(U32.to_nat(words(U32.min(la, lb))), EQ{}, Array.get(U32, xa, 0), Array.get(U32, ya, 0), 0))

Uses (10)

Used by (0)

No other definition uses this definition.