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
009db676
Commit
009db676
authored
Apr 15, 2011
by
antirez
Browse files
addReplyLongLong optimized to return shared objects when the value to reply is 0 or 1
parent
2e667806
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/networking.c
View file @
009db676
...
...
@@ -321,7 +321,12 @@ void _addReplyLongLong(redisClient *c, long long ll, char prefix) {
}
void
addReplyLongLong
(
redisClient
*
c
,
long
long
ll
)
{
_addReplyLongLong
(
c
,
ll
,
':'
);
if
(
ll
==
0
)
addReply
(
c
,
shared
.
czero
);
else
if
(
ll
==
1
)
addReply
(
c
,
shared
.
cone
);
else
_addReplyLongLong
(
c
,
ll
,
':'
);
}
void
addReplyMultiBulkLen
(
redisClient
*
c
,
long
length
)
{
...
...
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