def checked
bendvy-ecs-core@0.1.0.3 · entity_allocator.bend:48
import bendvy-ecs-core@0.1.0.3/entity_allocator.bend as EntityAllocator
import Base
import entity_key.bend as K
48def checked(allocator:Allocator,+key:K.Key,mode:U32) -> Allocator & Bool:
49 match allocator:
50 case Allocator{+next,high,slots,+capacity,depth,free,order}:checked_bounds(Bool.and(U32.is_lt(0,K.index(key)),Bool.and(U32.is_lt(K.index(key),next),U32.is_lt(K.index(key),capacity))),Allocator{next,high,slots,capacity,depth,free,order},key,mode)