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
8f59f131
Unverified
Commit
8f59f131
authored
Jul 03, 2021
by
Madelyn Olson
Committed by
GitHub
Jul 03, 2021
Browse files
Update incrDecrCommand to use addReplyLongLong (#9188)
Update incrDecrCommand to use addReplyLongLong
parent
aa139e2f
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/server.c
View file @
8f59f131
...
...
@@ -2479,7 +2479,6 @@ void createSharedObjects(void) {
shared
.
queued
=
createObject
(
OBJ_STRING
,
sdsnew
(
"+QUEUED
\r\n
"
));
shared
.
emptyscan
=
createObject
(
OBJ_STRING
,
sdsnew
(
"*2
\r\n
$1
\r\n
0
\r\n
*0
\r\n
"
));
shared
.
space
=
createObject
(
OBJ_STRING
,
sdsnew
(
" "
));
shared
.
colon
=
createObject
(
OBJ_STRING
,
sdsnew
(
":"
));
shared
.
plus
=
createObject
(
OBJ_STRING
,
sdsnew
(
"+"
));
/* Shared command error responses */
...
...
src/server.h
View file @
8f59f131
...
...
@@ -1025,7 +1025,7 @@ struct sentinelConfig {
struct
sharedObjectsStruct
{
robj
*
crlf
,
*
ok
,
*
err
,
*
emptybulk
,
*
czero
,
*
cone
,
*
pong
,
*
space
,
*
colon
,
*
queued
,
*
null
[
4
],
*
nullarray
[
4
],
*
emptymap
[
4
],
*
emptyset
[
4
],
*
queued
,
*
null
[
4
],
*
nullarray
[
4
],
*
emptymap
[
4
],
*
emptyset
[
4
],
*
emptyarray
,
*
wrongtypeerr
,
*
nokeyerr
,
*
syntaxerr
,
*
sameobjecterr
,
*
outofrangeerr
,
*
noscripterr
,
*
loadingerr
,
*
slowscripterr
,
*
bgsaveerr
,
*
masterdownerr
,
*
roslaveerr
,
*
execaborterr
,
*
noautherr
,
*
noreplicaserr
,
...
...
src/t_string.c
View file @
8f59f131
...
...
@@ -615,9 +615,7 @@ void incrDecrCommand(client *c, long long incr) {
signalModifiedKey
(
c
,
c
->
db
,
c
->
argv
[
1
]);
notifyKeyspaceEvent
(
NOTIFY_STRING
,
"incrby"
,
c
->
argv
[
1
],
c
->
db
->
id
);
server
.
dirty
++
;
addReply
(
c
,
shared
.
colon
);
addReply
(
c
,
new
);
addReply
(
c
,
shared
.
crlf
);
addReplyLongLong
(
c
,
value
);
}
void
incrCommand
(
client
*
c
)
{
...
...
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