Bucket_Array module

bucket_array_remove

procedure · 1 overloadSource

Removes the element at locator, freeing its slot for a later add. Fails an assert when the locator names a free or invalid slot.

The memory of the bucket is kept, and the element is not destroyed or cleared. No other element moves. To remove while looping, write remove value; in the for loop, with value the loop's variable (it by default), instead of calling this with a locator.

ExampleOpen in playground ↗
array: Bucket_Array(int, 2);
for 1..4 bucket_array_add(*array, it);
for value: array {
    if value % 2 == 0 remove value;
}
assert(array.count == 2);
bucket_array_reset(*array);
bucket_array_remove :: (array: *Bucket_Array, locator: Bucket_Locator)

Parameters

array: *Bucket_Array

See also