23 lines
		
	
	
		
			607 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			607 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
|   wapp_debug_assert(src != NULL && dst != NULL, "`src` and `dst` should not be NULL");
 | |
| 
 | |
|   wapp_{Tlower}_array_clear(dst);
 | |
| 
 | |
|   {T} *item;
 | |
| 
 | |
|   // NOTE (Abdelrahman): Uses a while loop instead of a for loop to get rid of
 | |
|   // MSVC Spectre mitigation warnings
 | |
|   u64 to_copy    = src->count < dst->capacity ? src->count : dst->capacity;
 | |
|   u64 item_index = 0;
 | |
|   b32 running    = true;
 | |
|   while (running) {{
 | |
|     item = wapp_{Tlower}_array_get(src, item_index);
 | |
|     ++item_index;
 | |
|     running = item_index < to_copy;
 | |
| 
 | |
|     if (!item) {{
 | |
|       continue;
 | |
|     }}
 | |
|     
 | |
|     wapp_{Tlower}_array_append_capped(dst, item);
 | |
|   }}
 |