27 lines
		
	
	
		
			619 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			619 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
|   if (!array || !other) {{
 | |
|     return;
 | |
|   }}
 | |
| 
 | |
|   u64 remaining_capacity = array->capacity - array->count;
 | |
|   if (other->count >= remaining_capacity) {{
 | |
|     return;
 | |
|   }}
 | |
| 
 | |
|   {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);
 | |
|   }} |