diff options
author | antirez <antirez@gmail.com> | 2016-05-30 15:31:19 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2016-05-30 15:31:19 +0200 |
commit | 5d4b5fbd6f0105bfac6ec97e29f1f6f142a0b1ac (patch) | |
tree | 34ad84328c1c4f639d297076a29194ccfee075a2 /deps | |
parent | 18a513f86d5cd53350c988780b409d37fa438834 (diff) | |
download | redis-5d4b5fbd6f0105bfac6ec97e29f1f6f142a0b1ac.tar.gz |
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.
Diffstat (limited to 'deps')
-rw-r--r-- | deps/geohash-int/geohash_helper.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |