From 5d4b5fbd6f0105bfac6ec97e29f1f6f142a0b1ac Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 30 May 2016 15:31:19 +0200 Subject: [PATCH] Geo: fix typo in geohashEstimateStepsByRadius(). I'm the author of this line but I can't see a good reason for it to don't be a typo, a step of 26 should be valid with 52 bits per coordinate, moreover the line was: if (step > 26) step = 25; So a step of 26 was actually already used, except when one of 27 was computed (which is invalid) only then it was trimmed to 25 instead of 26. All tests passing after the change. --- deps/geohash-int/geohash_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps/geohash-int/geohash_helper.c b/deps/geohash-int/geohash_helper.c index acfb34cde..4b8894676 100644 --- a/deps/geohash-int/geohash_helper.c +++ b/deps/geohash-int/geohash_helper.c @@ -72,7 +72,7 @@ uint8_t geohashEstimateStepsByRadius(double range_meters, double lat) { /* Frame to valid range. */ if (step < 1) step = 1; - if (step > 26) step = 25; + if (step > 26) step = 26; return step; }