def abandon_pending_checked
import bendvy-ecs-core@0.1.0.3/entity_allocator.bend as EntityAllocatorimport Base
import entity_key.bend as K
120def abandon_pending_checked(+key:K.Key,next:Allocator -> Allocator & List<&2,K.Key>,observed:Allocator & Bool) -> Allocator & List<&2,K.Key>:
121 match observed:
122 case (allocator,True{}):next(write_phase(allocator,key,Consumed{}))
123 case (allocator,False{}):abandon_pending_kept(key,next(allocator))