Skip to content

Commit

Permalink
Merge pull request #4105 from spinlock/unstable-networking
Browse files Browse the repository at this point in the history
Optimize addReplyBulkSds for better performance
  • Loading branch information
antirez committed Jul 6, 2017
2 parents 2d5aa00 + 10db81a commit 38dd30a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ lcov:
@genhtml --legend -o lcov-html redis.info

test-sds: sds.c sds.h
$(REDIS_CC) sds.c zmalloc.c -DSDS_TEST_MAIN -o /tmp/sds_test
$(REDIS_CC) sds.c zmalloc.c -DSDS_TEST_MAIN $(FINAL_LIBS) -o /tmp/sds_test
/tmp/sds_test

.PHONY: lcov
Expand Down
3 changes: 1 addition & 2 deletions src/networking.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 38dd30a

Please sign in to comment.