Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
d6f4c262
Commit
d6f4c262
authored
May 16, 2010
by
antirez
Browse files
faster INCR with very little efforts...
parent
0f3010ab
Changes
1
Hide whitespace changes
Inline
Side-by-side
redis.c
View file @
d6f4c262
...
@@ -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);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment