mirror of
https://github.com/fluencelabs/redis
synced 2025-03-16 15:40:49 +00:00
dont take the fast path for INCR if the resulting integer will fit into a shared integer range
This commit is contained in:
parent
b215a496a4
commit
a15742a41b
@ -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++;
|
||||
|
Loading…
x
Reference in New Issue
Block a user