Vec.Vec.push.grow: def of bend-kit-collections@0.1.4.1 Import: import bend-kit-collections@0.1.4.1/vec.bend as Vec Lines 32-41 of bend-kit-collections@0.1.4.1/vec.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-collections@0.1.4.1/vec.bend&start_line=32&end_line=41 import Base def Vec.push.grow( ~T: Data, full: Bool, +n: U32, +x: T, buf: Array, +cap: U32 ) -> Vec: match full: case False{}: Vec{U32.inc(n), Array.set(T, buf, n, x)} case True{}: # Every slot of big starts as x, so slot n needs no write. big = Array.new(T, 1n+U32.log2(cap), x) Vec{U32.inc(n), Vec.copy(~T, U32.to_nat(n), 0, big, Array.get(T, buf, 0))} Uses (12): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array.get https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array.new https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array.set https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.inc https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.log2 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=bend-kit-collections@0.1.4.1/vec.bend&name=Vec https://jend.leeeet.dev/definition.txt?path=bend-kit-collections@0.1.4.1/vec.bend&name=Vec.copy