Skip to content

Commit

Permalink
faster INCR with very little efforts...
Browse files Browse the repository at this point in the history
  • Loading branch information
antirez authored and ngmoco:) committed Jun 4, 2010
1 parent 82c4693 commit 998be49
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions redis.c
Original file line number Diff line number Diff line change
Expand Up @@ -4369,8 +4369,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);
Expand Down

0 comments on commit 998be49

Please sign in to comment.