jovany-wang commented on a change in pull request #73: [ISSUE #71]Fixed the 
issue that dangling reference returned when getting message property .
URL: https://github.com/apache/rocketmq-client-cpp/pull/73#discussion_r249427795
 
 

 ##########
 File path: src/message/MQMessage.cpp
 ##########
 @@ -109,9 +112,9 @@ void MQMessage::setPropertyInternal(const string& name, 
const string& value) {
 
 const string & MQMessage::getProperty(const string& name) const {
   map<string, string>::const_iterator it = m_properties.find(name);
-  if(it == m_properties.end()){
-    return "";
-  }else{
+  if (it == m_properties.end()) {
+    return EMPTY_STRING;
+  } else {
 
 Review comment:
   nice catch for the code style.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to