pnoltes commented on a change in pull request #373:
URL: https://github.com/apache/celix/pull/373#discussion_r739814363



##########
File path: libs/framework/include/celix/ServiceRegistrationBuilder.h
##########
@@ -69,22 +71,22 @@ namespace celix {
          *
          * If a key is already present the value will be overridden.
          */
-        ServiceRegistrationBuilder& addProperty(std::string key, std::string 
value) { properties.set(std::move(key), std::move(value)); return *this; }
+        ServiceRegistrationBuilder& addProperty(const std::string& key, const 
std::string& value) { properties.set(key, value); return *this; }

Review comment:
       Because eventually the C++ string key and value c_str() will be used to 
set a property in a celix_properties_t C object and in that case a move/copy of 
a std::string will be unnecessary overhead. 
   
   If the C++ properties where storing key and values as std::string, the a 
argument by value would indeed be better.




-- 
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-unsubscr...@celix.apache.org

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


Reply via email to