1
0
mirror of https://github.com/fluencelabs/redis synced 2025-04-02 07:41:04 +00:00

Merge pull request from zwkno1/unstable

fix geohashEncode bug when step > 30
This commit is contained in:
Salvatore Sanfilippo 2018-06-14 14:01:40 +02:00 committed by GitHub
commit 40d5df6547
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -144,8 +144,8 @@ int geohashEncode(const GeoHashRange *long_range, const GeoHashRange *lat_range,
(longitude - long_range->min) / (long_range->max - long_range->min); (longitude - long_range->min) / (long_range->max - long_range->min);
/* convert to fixed point based on the step size */ /* convert to fixed point based on the step size */
lat_offset *= (1 << step); lat_offset *= (1ULL << step);
long_offset *= (1 << step); long_offset *= (1ULL << step);
hash->bits = interleave64(lat_offset, long_offset); hash->bits = interleave64(lat_offset, long_offset);
return 1; return 1;
} }