]> git.saurik.com Git - redis.git/commitdiff
use shared replies for hset
authorPieter Noordhuis <pcnoordhuis@gmail.com>
Thu, 15 Apr 2010 13:38:48 +0000 (15:38 +0200)
committerPieter Noordhuis <pcnoordhuis@gmail.com>
Thu, 15 Apr 2010 17:16:39 +0000 (19:16 +0200)
redis.c

diff --git a/redis.c b/redis.c
index 9439c8e5f574876c956f7480ca17e6e1417fb5f6..773b3657c9bfcca59990762d14ff0b4fb8a107c4 100644 (file)
--- a/redis.c
+++ b/redis.c
@@ -6242,13 +6242,13 @@ static robj *hashLookupWriteOrCreate(redisClient *c, robj *key) {
 
 /* ============================= Hash commands ============================== */
 static void hsetCommand(redisClient *c) {
-    int update = 0;
+    int update;
     robj *o;
 
     if ((o = hashLookupWriteOrCreate(c,c->argv[1])) == NULL) return;
     hashTryConversion(o,c->argv,2,3);
     update = hashReplace(o,c->argv[2],c->argv[3]);
-    addReplySds(c,sdscatprintf(sdsempty(),":%d\r\n",update == 0));
+    addReply(c, update ? shared.czero : shared.cone);
     server.dirty++;
 }