fix: operator< Cell Cell now sorts by y first, then x
This commit is contained in:
		
							parent
							
								
									8b2b0ac34e
								
							
						
					
					
						commit
						e607482867
					
				| 
						 | 
				
			
			@ -185,8 +185,7 @@ bool operator!=(Cell const &lhs, Cell const &rhs) {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
bool operator<(Cell const &lhs, Cell const &rhs) {
 | 
			
		||||
	uintptr_t hashl{ uintptr_t(lhs.x * 73856093) ^ uintptr_t(lhs.y * 19349663) };
 | 
			
		||||
	uintptr_t hashr{ uintptr_t(rhs.x * 73856093) ^ uintptr_t(rhs.y * 19349663) };
 | 
			
		||||
	return hashl < hashr;
 | 
			
		||||
	if (lhs.y == rhs.y) return lhs.x < rhs.x;
 | 
			
		||||
	else return lhs.y < rhs.y;
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue