summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspinlock <wnzheng@gmail.com>2017-07-05 14:25:05 +0000
committerspinlock <wnzheng@gmail.com>2017-07-05 14:25:05 +0000
commitea31a4eae3c667ffb8c33241c5de699652710394 (patch)
tree661176c9f338ef23b9562fc55ca04d50dadc1a01
parent09dd7b5ff02de4a311032939c27fd6fc62fbd4a3 (diff)
downloadredis-ea31a4eae3c667ffb8c33241c5de699652710394.tar.gz
Optimize addReplyBulkSds for better performance
-rw-r--r--src/networking.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/networking.c b/src/networking.c
index 27006514d..98e779642 100644
--- a/src/networking.c
+++ b/src/networking.c
@@ -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) */
void addReplyBulkSds(client *c, sds s) {
- addReplySds(c,sdscatfmt(sdsempty(),"$%u\r\n",
- (unsigned long)sdslen(s)));
+ addReplyLongLongWithPrefix(c,sdslen(s),'$');
addReplySds(c,s);
addReply(c,shared.crlf);
}