From 6e9e463f8014cbde1eaabe4c59045471e1871b74 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Thu, 15 Apr 2010 15:38:48 +0200 Subject: [PATCH] use shared replies for hset --- redis.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/redis.c b/redis.c index 9439c8e5..773b3657 100644 --- 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++; }