mirror of
				https://git.proxmox.com/git/libgit2
				synced 2025-11-04 07:09:14 +00:00 
			
		
		
		
	Now with no multiply
This commit is contained in:
		
							parent
							
								
									11d9f6b304
								
							
						
					
					
						commit
						590365db54
					
				@ -20,8 +20,8 @@ GIT_INLINE(size_t) compute_new_size(git_vector *v)
 | 
			
		||||
	 * instructions and less than the golden ratio (1.618...) */
 | 
			
		||||
	if (new_size < MIN_ALLOCSIZE)
 | 
			
		||||
		new_size = MIN_ALLOCSIZE;
 | 
			
		||||
	else if (new_size <= SIZE_MAX / 3)
 | 
			
		||||
		new_size = new_size * 3 / 2 + 1;
 | 
			
		||||
	else if (new_size <= (SIZE_MAX / 3) * 2)
 | 
			
		||||
		new_size += new_size / 2;
 | 
			
		||||
	else
 | 
			
		||||
		new_size = SIZE_MAX;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user