Permalink
Browse files

use shared replies for hset

  • Loading branch information...
1 parent 0c390ab commit 6e9e463f8014cbde1eaabe4c59045471e1871b74 @pietern pietern committed Apr 15, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 redis.c
View
@@ -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++;
}

0 comments on commit 6e9e463

Please sign in to comment.