]> git.saurik.com Git - redis.git/commitdiff
WITHSCORES in ZRANGEBYSCORE thanks to Sam Hendley
authorantirez <antirez@gmail.com>
Sun, 7 Feb 2010 09:32:28 +0000 (10:32 +0100)
committerantirez <antirez@gmail.com>
Sun, 7 Feb 2010 09:32:28 +0000 (10:32 +0100)
redis.c

diff --git a/redis.c b/redis.c
index f60569deb9e1d2e6a720aa2c4ba36553c11412ce..c0956490cb81836348bb7eb9323da8f1cdcc485e 100644 (file)
--- a/redis.c
+++ b/redis.c
@@ -5201,14 +5201,14 @@ static void zrangebyscoreCommand(redisClient *c) {
     int badsyntax = 0;
 
     if (c->argc == 5 || c->argc == 8) {
-        if (strcasecmp(c->argv[c->argc-1]->ptr,"withscores") == 0) withscores = 1;
-        else badsyntax = 1;
+        if (strcasecmp(c->argv[c->argc-1]->ptr,"withscores") == 0)
+            withscores = 1;
+        else
+            badsyntax = 1;
     }
 
-    if (c->argc != (4 + withscores) && c->argc != (7 + withscores)) {
+    if (c->argc != (4 + withscores) && c->argc != (7 + withscores))
         badsyntax = 1;
-    }
-
 
     if (badsyntax) {
         addReplySds(c,