You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2020/12/10 16:25:04 UTC

[GitHub] [nifi-minifi-cpp] arpadboda commented on a change in pull request #911: MINIFICPP-1373 - Add proper FlowFile::getAttribute getter [QoL][mini-PR]

arpadboda commented on a change in pull request #911:
URL: https://github.com/apache/nifi-minifi-cpp/pull/911#discussion_r540307778



##########
File path: libminifi/include/core/FlowFile.h
##########
@@ -129,7 +130,9 @@ class FlowFile : public core::Connectable, public ReferenceContainer {
    * @param value value to set
    * @return result of finding key
    */
-  bool getAttribute(std::string key, std::string& value) const;
+  bool getAttribute(const std::string& key, std::string& value) const;
+
+  utils::optional<std::reference_wrapper<const std::string>> getAttribute(const std::string& key) const;

Review comment:
       +1. 
   
   Moreover I also think that copying a string is not going to be the bottleneck in this software, so for safety reasons I would simply make it a copy. 




----------------------------------------------------------------
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.

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