Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
a15742a4
"vscode:/vscode.git/clone" did not exist on "f3357792408fd28002847586a27f9043e08a4e2c"
Commit
a15742a4
authored
Dec 10, 2010
by
antirez
Browse files
dont take the fast path for INCR if the resulting integer will fit into a shared integer range
parent
b215a496
Changes
1
Show whitespace changes
Inline
Side-by-side
src/t_string.c
View file @
a15742a4
...
@@ -149,7 +149,8 @@ void incrDecrCommand(redisClient *c, long long incr) {
...
@@ -149,7 +149,8 @@ void incrDecrCommand(redisClient *c, long long incr) {
if
(
o
&&
o
->
refcount
==
1
&&
o
->
encoding
==
REDIS_ENCODING_INT
)
{
if
(
o
&&
o
->
refcount
==
1
&&
o
->
encoding
==
REDIS_ENCODING_INT
)
{
long
long
newval
=
((
long
)
o
->
ptr
)
+
incr
;
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
;
o
->
ptr
=
(
void
*
)
(
long
)
newval
;
touchWatchedKey
(
c
->
db
,
c
->
argv
[
1
]);
touchWatchedKey
(
c
->
db
,
c
->
argv
[
1
]);
server
.
dirty
++
;
server
.
dirty
++
;
...
...
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