projects
/
redis.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b215a49
)
dont take the fast path for INCR if the resulting integer will fit into a shared...
author
antirez
<antirez@gmail.com>
Fri, 10 Dec 2010 16:23:38 +0000
(17:23 +0100)
committer
antirez
<antirez@gmail.com>
Fri, 10 Dec 2010 16:23:38 +0000
(17:23 +0100)
src/t_string.c
patch
|
blob
|
blame
|
history
diff --git
a/src/t_string.c
b/src/t_string.c
index cc6526fbe8b152327d84a0ce3dea902a49ed2b10..bb6b4eceb5628dbf258e2452ab7e28a88851811c 100644
(file)
--- a/
src/t_string.c
+++ b/
src/t_string.c
@@
-149,7
+149,8
@@
void incrDecrCommand(redisClient *c, long long incr) {
if (o && o->refcount == 1 && o->encoding == REDIS_ENCODING_INT) {
long long newval = ((long)o->ptr) + incr;
- if (newval >= LONG_MIN && newval <= LONG_MAX) {
+ if (newval < 0 && newval >= REDIS_SHARED_INTEGERS &&
+ newval >= LONG_MIN && newval <= LONG_MAX) {
o->ptr = (void*) (long) newval;
touchWatchedKey(c->db,c->argv[1]);
server.dirty++;