提交 a71f072f 编写于 作者: P Pieter Noordhuis

move retrieval of long up to prevent an empty hash from being created

上级 bc554569
......@@ -6166,6 +6166,8 @@ static void hincrbyCommand(redisClient *c) {
long long value = 0, incr = 0;
robj *o = lookupKeyWrite(c->db,c->argv[1]);
if (getLongLongFromObject(c, c->argv[3], &incr) != REDIS_OK) return;
if (o == NULL) {
o = createHashObject();
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) {
unsigned char *zm = o->ptr;
unsigned char *zval;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册