mirror of
https://github.com/fluencelabs/redis
synced 2025-03-21 01:50:50 +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 ============================== */
|
/* ============================= Hash commands ============================== */
|
||||||
static void hsetCommand(redisClient *c) {
|
static void hsetCommand(redisClient *c) {
|
||||||
int update = 0;
|
int update;
|
||||||
robj *o;
|
robj *o;
|
||||||
|
|
||||||
if ((o = hashLookupWriteOrCreate(c,c->argv[1])) == NULL) return;
|
if ((o = hashLookupWriteOrCreate(c,c->argv[1])) == NULL) return;
|
||||||
hashTryConversion(o,c->argv,2,3);
|
hashTryConversion(o,c->argv,2,3);
|
||||||
update = hashReplace(o,c->argv[2],c->argv[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++;
|
server.dirty++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user