def eocd.go

bend-kit-archive@0.5.1.0 · archive.bend:95

import bend-kit-archive@0.5.1.0/archive.bend as Archive
import Base

95# f counts the positions left below p; a comment is at most 65535 bytes.
96def eocd.go(f: Nat, r: Array<U32> & Bool, +len: U32, +p: U32) -> Array<U32> & Maybe<&2, U32>:
97  match f:
98    case 0n:
99      (a, hit) = r
100      (a, Bool.pick(Maybe<&2, U32>, hit, Some{p}, None{}))
101    case 1n+q:
102      (a, hit) = r
103      match hit:
104        case True{}:
105          (a, Some{p})
106        case False{}:
107          eocd.go(q, eocd.win(a, len, (p - 1 : U32)), len, (p - 1 : U32))

Uses (10)

Used by (1)