DynamicArray.reserve_room_at: def of bend-collections@1.0.0.0 Import: import bend-collections@1.0.0.0/src/containers/dynamic_array.bend as DynamicArray Lines 402-410 of bend-collections@1.0.0.0/src/containers/dynamic_array.bend: https://jend.leeeet.dev/read.txt?path=bend-collections@1.0.0.0/src/containers/dynamic_array.bend&start_line=402&end_line=410 import Base import bend-collections@1.0.0.0/src/containers/types/dynamic_array.bend as E # The feasibility test (n <= 2^limit) is only reached when the cached capacity # does not already suffice: computing 2^limit is O(limit) and reserve is # otherwise O(1). def reserve_room_at(~T: Data, +limit: Nat, +depth: Nat, +cap: Nat, len: Nat, arr: Array>, +n: Nat, feasible: Bool) -> DynArray<&2, T> & Result<&2, &2, E.Error, Unit>: match feasible: case True{}: (grow_until_at(~T, Nat.sub(limit, depth), n, DA{limit, depth, cap, len, arr}), Done{Unit{}}) case False{}: (DA{limit, depth, cap, len, arr}, Fail{E.CapacityExceeded{}}) 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=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Unit https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/containers/dynamic_array.bend&name=DynArray https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/containers/dynamic_array.bend&name=grow_until_at https://jend.leeeet.dev/definition.txt?path=bend-collections@1.0.0.0/src/containers/types/dynamic_array.bend&name=Error