24 lines
		
	
	
		
			707 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			707 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
|   wapp_debug_assert(array != NULL && other != NULL, "`array` and `other` should not be NULL");
 | |
| 
 | |
|   u64 remaining_capacity = array->capacity - array->count;
 | |
|   wapp_runtime_assert(other->count < remaining_capacity, "`array` does not have enough 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;
 | |
|   b32 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);
 | |
|   }}
 |