mirror of
https://github.com/fluencelabs/redis
synced 2025-04-01 23:31:03 +00:00
Update geohash.c
fix geohasEncode bug when step > 31
This commit is contained in:
parent
94751543b0
commit
7659619824
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user