mirror of
https://github.com/fluencelabs/redis
synced 2025-06-21 13:01:32 +00:00
Geo: sync faster decoding from krtm that synched from Ardb.
Instead of successive divisions in iteration the new code uses bitwise magic to interleave / deinterleave two 32bit values into a 64bit one. All tests still passing and is measurably faster, so worth it.
This commit is contained in:
@ -164,7 +164,7 @@ double extractDistanceOrReply(redisClient *c, robj **argv,
|
||||
* than "5.2144992818115 meters away." We provide 4 digits after the dot
|
||||
* so that the returned value is decently accurate even when the unit is
|
||||
* the kilometer. */
|
||||
inline void addReplyDoubleDistance(redisClient *c, double d) {
|
||||
void addReplyDoubleDistance(redisClient *c, double d) {
|
||||
char dbuf[128];
|
||||
int dlen = snprintf(dbuf, sizeof(dbuf), "%.4f", d);
|
||||
addReplyBulkCBuffer(c, dbuf, dlen);
|
||||
|
Reference in New Issue
Block a user