Commit d6f4c262 authored by antirez's avatar antirez
Browse files

faster INCR with very little efforts...

parent 0f3010ab
...@@ -4334,8 +4334,7 @@ static void incrDecrCommand(redisClient *c, long long incr) { ...@@ -4334,8 +4334,7 @@ static void incrDecrCommand(redisClient *c, long long incr) {
if (getLongLongFromObjectOrReply(c,o,&value,NULL) != REDIS_OK) return; if (getLongLongFromObjectOrReply(c,o,&value,NULL) != REDIS_OK) return;
value += incr; value += incr;
o = createObject(REDIS_STRING,sdscatprintf(sdsempty(),"%lld",value)); o = createStringObjectFromLongLong(value);
o = tryObjectEncoding(o);
retval = dictAdd(c->db->dict,c->argv[1],o); retval = dictAdd(c->db->dict,c->argv[1],o);
if (retval == DICT_ERR) { if (retval == DICT_ERR) {
dictReplace(c->db->dict,c->argv[1],o); dictReplace(c->db->dict,c->argv[1],o);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment