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
ea31a4ea
Commit
ea31a4ea
authored
Jul 05, 2017
by
spinlock
Browse files
Optimize addReplyBulkSds for better performance
parent
09dd7b5f
Changes
1
Show whitespace changes
Inline
Side-by-side
src/networking.c
View file @
ea31a4ea
...
@@ -561,8 +561,7 @@ void addReplyBulkCBuffer(client *c, const void *p, size_t len) {
...
@@ -561,8 +561,7 @@ void addReplyBulkCBuffer(client *c, const void *p, size_t len) {
/* Add sds to reply (takes ownership of sds and frees it) */
/* Add sds to reply (takes ownership of sds and frees it) */
void
addReplyBulkSds
(
client
*
c
,
sds
s
)
{
void
addReplyBulkSds
(
client
*
c
,
sds
s
)
{
addReplySds
(
c
,
sdscatfmt
(
sdsempty
(),
"$%u
\r\n
"
,
addReplyLongLongWithPrefix
(
c
,
sdslen
(
s
),
'$'
);
(
unsigned
long
)
sdslen
(
s
)));
addReplySds
(
c
,
s
);
addReplySds
(
c
,
s
);
addReply
(
c
,
shared
.
crlf
);
addReply
(
c
,
shared
.
crlf
);
}
}
...
...
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