From a86ff325177880d85934113f5965f9e5cef1502d Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sun, 21 Feb 2021 16:22:00 -0500 Subject: [PATCH] No reason to use the less clear implementation, is there? --- src/map/location.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/map/location.cpp b/src/map/location.cpp index ae9822217678..151f8686d2cc 100644 --- a/src/map/location.cpp +++ b/src/map/location.cpp @@ -546,13 +546,9 @@ std::size_t distance_between(const map_location& a, const map_location& b) { const std::size_t hdistance = std::abs(a.x - b.x); - const std::size_t vpenalty = ( (((a.x & 1)==0) && ((b.x & 1)==1) && (a.y < b.y)) - || (((b.x & 1)==0) && ((a.x & 1)==1) && (b.y < a.y)) ) ? 1 : 0; - -/* Don't want to include util.hpp in this header const std::size_t vpenalty = ( (is_even(a.x) && is_odd(b.x) && (a.y < b.y)) || (is_even(b.x) && is_odd(a.x) && (b.y < a.y)) ) ? 1 : 0; -*/ + // For any non-negative integer i, i - i/2 - i%2 == i/2 // previously returned (hdistance + vdistance - vsavings) // = hdistance + vdistance - minimum(vdistance,hdistance/2+hdistance%2)