24 lines
600 B
Plaintext
24 lines
600 B
Plaintext
assert(array != NULL && other != NULL);
|
|
|
|
u64 remaining_capacity = array->capacity - array->count;
|
|
assert(other->count < remaining_capacity);
|
|
|
|
{T} *item;
|
|
|
|
// NOTE (Abdelrahman): Uses a while loop instead of a for loop to get rid of
|
|
// MSVC Spectre mitigation warnings
|
|
u64 items_to_add = other->count;
|
|
u64 item_index = 0;
|
|
bool running = true;
|
|
while (running) {{
|
|
item = wapp_{Tlower}_array_get(other, item_index);
|
|
++item_index;
|
|
running = item_index < items_to_add;
|
|
|
|
if (!item) {{
|
|
continue;
|
|
}}
|
|
|
|
wapp_{Tlower}_array_append_capped(array, item);
|
|
}}
|