lordgamez commented on a change in pull request #870:
URL: https://github.com/apache/nifi-minifi-cpp/pull/870#discussion_r470465347



##########
File path: extensions/libarchive/MergeContent.cpp
##########
@@ -342,6 +352,50 @@ std::shared_ptr<core::FlowFile> 
ZipMerge::merge(core::ProcessContext *context, c
   return flowFile;
 }
 
+void AttributeMerger::mergeAttributes(core::ProcessSession *session, 
std::shared_ptr<core::FlowFile> &merge_flow) {
+  for (const auto& pair : getMergedAttributes()) {
+    session->putAttribute(merge_flow, pair.first, pair.second);
+  }
+}
+
+std::map<std::string, std::string> AttributeMerger::getMergedAttributes() {
+  std::map<std::string, std::string> merged_attributes;

Review comment:
       There was an error in the code you sent, both versions were called with 
manualLooping() :) But there was no difference in the result after fixing it.
   
   I was thinking about that move, but actually I was thinking referring to the 
other case, the Keep All Unique Attributes scenario. In that case we currently 
merge the attributes in place, but using the std::accumulate we cannot do that, 
and as there is no move support, I cannot consume the parameter, so I have to 
make a copy of that map. You can check the difference here:
   https://quick-bench.com/q/RauiICzYXNNBplQmLFj2bZ7z14E
   
   Btw thanks for this tool, I didn't know about this and it's pretty handy :)




----------------------------------------------------------------
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:
[email protected]


Reply via email to