]> git.saurik.com Git - redis.git/commitdiff
ZINCRSCOREBY => ZINCRBY
authorantirez <antirez@gmail.com>
Fri, 20 Nov 2009 08:18:40 +0000 (09:18 +0100)
committerantirez <antirez@gmail.com>
Fri, 20 Nov 2009 08:18:40 +0000 (09:18 +0100)
TODO
redis-cli.c
redis.c

diff --git a/TODO b/TODO
index a5f51f815762a084f71919867243bb7c81cb2f67..e1b1db6d67e8c97bb784c26739c1263cc8f27108 100644 (file)
--- a/TODO
+++ b/TODO
@@ -2,7 +2,6 @@ VERSION 1.1 TODO
 
 * For now only the last argument gets integer encoded, so make sure that: 1) every multi bulk commands implemented will have the last arg that is indeed a value, and not used otherwise. 2) to explicitly call the function to encode the object in MSET and other commands where there are multiple "values".
 * Man pages for MSET MSETNX and SRANDMEMBER, Z-commands, ...
-* ZSETs missing stuff: ZINCRBY
 * Use strcoll() to compare objects in sorted sets, like it already happens for SORT.
 * LPOPPUSH, EXPIRE, EXPIREAT, ZSCORE, SRANDMEMBER tests.
 * Write docs for the "STORE" operaiton of SORT, and GET "#" option.
index a1156b1070a06acd2f673b3325af10f06d439772..f34aef830d881e2ee1c1bdeacf79a7ccdd81b631 100644 (file)
@@ -93,7 +93,7 @@ static struct redisCommand cmdTable[] = {
     {"sdiffstore",-3,REDIS_CMD_INLINE},
     {"smembers",2,REDIS_CMD_INLINE},
     {"zadd",4,REDIS_CMD_BULK},
-    {"zincrscoreby",4,REDIS_CMD_BULK},
+    {"zincrby",4,REDIS_CMD_BULK},
     {"zrem",3,REDIS_CMD_BULK},
     {"zremrangebyscore",4,REDIS_CMD_INLINE},
     {"zrange",4,REDIS_CMD_INLINE},
diff --git a/redis.c b/redis.c
index b4be65a6060fc60909a0c8f6219d99132a5d472d..8b2a7939548ae98c12dde617bce34aea58402edf 100644 (file)
--- a/redis.c
+++ b/redis.c
@@ -466,7 +466,7 @@ static void debugCommand(redisClient *c);
 static void msetCommand(redisClient *c);
 static void msetnxCommand(redisClient *c);
 static void zaddCommand(redisClient *c);
-static void zincrscorebyCommand(redisClient *c);
+static void zincrbyCommand(redisClient *c);
 static void zrangeCommand(redisClient *c);
 static void zrangebyscoreCommand(redisClient *c);
 static void zrevrangeCommand(redisClient *c);
@@ -514,7 +514,7 @@ static struct redisCommand cmdTable[] = {
     {"sdiffstore",sdiffstoreCommand,-3,REDIS_CMD_INLINE|REDIS_CMD_DENYOOM},
     {"smembers",sinterCommand,2,REDIS_CMD_INLINE},
     {"zadd",zaddCommand,4,REDIS_CMD_BULK|REDIS_CMD_DENYOOM},
-    {"zincrscoreby",zincrscorebyCommand,4,REDIS_CMD_BULK|REDIS_CMD_DENYOOM},
+    {"zincrby",zincrbyCommand,4,REDIS_CMD_BULK|REDIS_CMD_DENYOOM},
     {"zrem",zremCommand,3,REDIS_CMD_BULK},
     {"zremrangebyscore",zremrangebyscoreCommand,4,REDIS_CMD_INLINE},
     {"zrange",zrangeCommand,4,REDIS_CMD_INLINE},
@@ -4229,9 +4229,9 @@ static zskiplistNode *zslFirstWithScore(zskiplist *zsl, double score) {
 
 /* The actual Z-commands implementations */
 
-/* This generic command implements both ZADD and ZINCRSCOREBY.
+/* This generic command implements both ZADD and ZINCRBY.
  * scoreval is the score if the operation is a ZADD (doincrement == 0) or
- * the increment if the operation is a ZINCRSCOREBY (doincrement == 1). */
+ * the increment if the operation is a ZINCRBY (doincrement == 1). */
 static void zaddGenericCommand(redisClient *c, robj *key, robj *ele, double scoreval, int doincrement) {
     robj *zsetobj;
     zset *zs;
@@ -4250,7 +4250,7 @@ static void zaddGenericCommand(redisClient *c, robj *key, robj *ele, double scor
     }
     zs = zsetobj->ptr;
 
-    /* Ok now since we implement both ZADD and ZINCRSCOREBY here the code
+    /* Ok now since we implement both ZADD and ZINCRBY here the code
      * needs to handle the two different conditions. It's all about setting
      * '*score', that is, the new score to set, to the right value. */
     score = zmalloc(sizeof(double));
@@ -4270,7 +4270,7 @@ static void zaddGenericCommand(redisClient *c, robj *key, robj *ele, double scor
     }
 
     /* What follows is a simple remove and re-insert operation that is common
-     * to both ZADD and ZINCRSCOREBY... */
+     * to both ZADD and ZINCRBY... */
     if (dictAdd(zs->dict,ele,score) == DICT_OK) {
         /* case 1: New element */
         incrRefCount(ele); /* added to hash */
@@ -4317,7 +4317,7 @@ static void zaddCommand(redisClient *c) {
     zaddGenericCommand(c,c->argv[1],c->argv[3],scoreval,0);
 }
 
-static void zincrscorebyCommand(redisClient *c) {
+static void zincrbyCommand(redisClient *c) {
     double scoreval;
 
     scoreval = strtod(c->argv[2]->ptr,NULL);