def w.room
import bend-kit-json@0.7.0.0/json.bend as Jsonimport 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