wwbmmm commented on code in PR #3609:
URL: https://github.com/apache/brpc/pull/3609#discussion_r4305355806
##########
src/brpc/redis_command.cpp:
##########
@@ -85,12 +85,30 @@ inline void AppendHeader(butil::IOBuf& buf, char fc,
unsigned long value) {
buf.append(header, len + 3);
}
-static void FlushComponent(std::string* out, std::string* compbuf, int* ncomp)
{
- AppendHeader(*out, '$', compbuf->size());
- out->append(*compbuf);
- out->append("\r\n", 2);
+inline int AppendHeader(butil::IOBufAppender& buf, char fc,
Review Comment:
[replied by brpc-oncall robot] Since `FlushComponent` now writes through
`butil::IOBufAppender`, the old `inline void AppendHeader(std::string& buf,
char fc, unsigned long value)` overload above is no longer used anywhere in
this file (or elsewhere in the repo), and the header-building logic is now
duplicated three times. Please drop the `std::string` overload (a small
helper/template shared by the `IOBuf` and `IOBufAppender` versions would also
remove the duplication).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]