commit 882b3027e9458ad721220d773c5a1081104f8fbf
parent 74c704da5109b440ac4b1079107c1abbb2d45c2a
Author: Markus Hunner <26381538+markhun@users.noreply.github.com>
Date: Sat, 6 Jan 2024 16:43:39 +0100
Revert "labeling: Replace division by 2 with bitshift"
This reverts commit b8c0a7a242a1864db7849749c6a72eb034b7d93b.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/magichex/src/magichex.c b/magichex/src/magichex.c
@@ -337,7 +337,7 @@ void labeling(HexagonEntry hexagon[], unsigned long index, unsigned long *order)
HexagonEntry newHexagon[r*r];
// bisect the range [lo,hi] to new Hexagons and recurse on them.
- long midpoint = (hexagonEntry->lo + hexagonEntry->hi) >> 1;
+ long midpoint = (hexagonEntry->lo + hexagonEntry->hi)/2;
if(hexagonEntry->lo + hexagonEntry->hi < 0 && (hexagonEntry->lo + hexagonEntry->hi) % 2 != 0){
midpoint--; // nudge midpoint for negative values to avoid endless recursion
}