You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/08/25 14:36:42 UTC

[GitHub] [rocketmq-client-cpp] SRC-xiaojin commented on a diff in pull request #441: reduce unnecessary tmp copy

SRC-xiaojin commented on code in PR #441:
URL: https://github.com/apache/rocketmq-client-cpp/pull/441#discussion_r955050401


##########
src/protocol/RemotingCommand.cpp:
##########
@@ -302,6 +302,10 @@ void RemotingCommand::setMsgBody(const string& body) {
   m_msgBody = body;
 }
 
+void RemotingCommand::moveMsgBody(std::string&& body) {

Review Comment:
   > Why not provide an overloading method of SetBody, accepting a r-value reference to string
   
   because it is more easy to understand the "move" of the function,if overload method of SetBody,I think developer may use reference method, but not use r-value reference method~~



-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org