mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
Revert "Geo: output 10 chars of geohash, not 11."
This reverts commit 009862ab7e
.
This commit is contained in:
parent
5b9d3ac6c6
commit
e6e58e455c
@ -734,14 +734,14 @@ void geohashCommand(client *c) {
|
||||
r[1].max = 90;
|
||||
geohashEncode(&r[0],&r[1],xy[0],xy[1],26,&hash);
|
||||
|
||||
char buf[11];
|
||||
char buf[12];
|
||||
int i;
|
||||
for (i = 0; i < 10; i++) {
|
||||
for (i = 0; i < 11; i++) {
|
||||
int idx = (hash.bits >> (52-((i+1)*5))) & 0x1f;
|
||||
buf[i] = geoalphabet[idx];
|
||||
}
|
||||
buf[10] = '\0';
|
||||
addReplyBulkCBuffer(c,buf,10);
|
||||
buf[11] = '\0';
|
||||
addReplyBulkCBuffer(c,buf,11);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ start_server {tags {"geo"}} {
|
||||
r del points
|
||||
r geoadd points -5.6 42.6 test
|
||||
lindex [r geohash points test] 0
|
||||
} {ezs42e44yx}
|
||||
} {ezs42e44yx0}
|
||||
|
||||
test {GEOPOS simple} {
|
||||
r del points
|
||||
|
Loading…
Reference in New Issue
Block a user