def w.room

bend-kit-json@0.7.0.0 · json.bend:34

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

34# The buffer doubles when word k does not fit.
35def w.room(grow: Bool, buf: Array<U32>, +k: U32) -> Array<U32>:
36  match grow:
37    case True{}:
38      Bytes.grow((k * 4 : U32), buf, (k * 8 : U32))
39    case False{}:
40      buf

Uses (5)

Used by (2)