def ar.reset.size

bend-kit-regex@0.8.0.0 · regex.bend:1850

import bend-kit-regex@0.8.0.0/regex.bend as Regex
import Base

1850def ar.reset.size(fits: Bool, ths: List<&2, Th>, best: Maybe<&2, List<&2, Maybe<&2, U32>>>, old: Array<Th>, spare: Array<Th>, +count: U32, +cap: U32, +init: List<&2, Maybe<&2, U32>>) -> Ar:
1851  match fits:
1852    case True{}:
1853      Ar{ar.fill(ths, old, 0), spare, count, cap, best}
1854    case False{}:
1855      +depth = Nat.add(U32.log2(count), 1n)
1856      Ar{ar.fill(ths, Array.new(Th, depth, Th{0, init}), 0), Array.new(Th, depth, Th{0, init}), count, U32.shln(1, depth), best}

Uses (12)

Used by (1)