faster INCR with very little efforts...

This commit is contained in:
antirez 2010-05-16 00:59:08 +02:00
parent 0f3010ab0d
commit d6f4c262a1
1 changed files with 1 additions and 2 deletions

View File

@ -4334,8 +4334,7 @@ static void incrDecrCommand(redisClient *c, long long incr) {
if (getLongLongFromObjectOrReply(c,o,&value,NULL) != REDIS_OK) return;
value += incr;
o = createObject(REDIS_STRING,sdscatprintf(sdsempty(),"%lld",value));
o = tryObjectEncoding(o);
o = createStringObjectFromLongLong(value);
retval = dictAdd(c->db->dict,c->argv[1],o);
if (retval == DICT_ERR) {
dictReplace(c->db->dict,c->argv[1],o);