mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 17:10:50 +00:00
move retrieval of long up to prevent an empty hash from being created
This commit is contained in:
parent
bc55456975
commit
a71f072f73
4
redis.c
4
redis.c
@ -6166,6 +6166,8 @@ static void hincrbyCommand(redisClient *c) {
|
|||||||
long long value = 0, incr = 0;
|
long long value = 0, incr = 0;
|
||||||
robj *o = lookupKeyWrite(c->db,c->argv[1]);
|
robj *o = lookupKeyWrite(c->db,c->argv[1]);
|
||||||
|
|
||||||
|
if (getLongLongFromObject(c, c->argv[3], &incr) != REDIS_OK) return;
|
||||||
|
|
||||||
if (o == NULL) {
|
if (o == NULL) {
|
||||||
o = createHashObject();
|
o = createHashObject();
|
||||||
dictAdd(c->db->dict,c->argv[1],o);
|
dictAdd(c->db->dict,c->argv[1],o);
|
||||||
@ -6177,8 +6179,6 @@ static void hincrbyCommand(redisClient *c) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getLongLongFromObject(c, c->argv[3], &incr) != REDIS_OK) return;
|
|
||||||
|
|
||||||
if (o->encoding == REDIS_ENCODING_ZIPMAP) {
|
if (o->encoding == REDIS_ENCODING_ZIPMAP) {
|
||||||
unsigned char *zm = o->ptr;
|
unsigned char *zm = o->ptr;
|
||||||
unsigned char *zval;
|
unsigned char *zval;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user