mirror of
https://github.com/fluencelabs/redis
synced 2025-03-20 09:30:55 +00:00
use shared replies for hset
This commit is contained in:
parent
0c390abc69
commit
6e9e463f80
4
redis.c
4
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++;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user