mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 09:00:51 +00:00
Geo: fix GEOHASH return value for consistency.
The same thing observed in #3551 by gnethercutt also fixed for GEOHASH as the original PR did.
This commit is contained in:
parent
913070a9e8
commit
0f72257049
@ -684,16 +684,15 @@ void geohashCommand(client *c) {
|
|||||||
int j;
|
int j;
|
||||||
|
|
||||||
/* Look up the requested zset */
|
/* Look up the requested zset */
|
||||||
robj *zobj = NULL;
|
robj *zobj = lookupKeyRead(c->db, c->argv[1]);
|
||||||
if ((zobj = lookupKeyReadOrReply(c, c->argv[1], shared.emptymultibulk))
|
if (zobj && checkType(c, zobj, OBJ_ZSET)) return;
|
||||||
== NULL || checkType(c, zobj, OBJ_ZSET)) return;
|
|
||||||
|
|
||||||
/* Geohash elements one after the other, using a null bulk reply for
|
/* Geohash elements one after the other, using a null bulk reply for
|
||||||
* missing elements. */
|
* missing elements. */
|
||||||
addReplyMultiBulkLen(c,c->argc-2);
|
addReplyMultiBulkLen(c,c->argc-2);
|
||||||
for (j = 2; j < c->argc; j++) {
|
for (j = 2; j < c->argc; j++) {
|
||||||
double score;
|
double score;
|
||||||
if (zsetScore(zobj, c->argv[j]->ptr, &score) == C_ERR) {
|
if (!zobj || zsetScore(zobj, c->argv[j]->ptr, &score) == C_ERR) {
|
||||||
addReply(c,shared.nullbulk);
|
addReply(c,shared.nullbulk);
|
||||||
} else {
|
} else {
|
||||||
/* The internal format we use for geocoding is a bit different
|
/* The internal format we use for geocoding is a bit different
|
||||||
|
Loading…
x
Reference in New Issue
Block a user