szaszm commented on a change in pull request #870:
URL: https://github.com/apache/nifi-minifi-cpp/pull/870#discussion_r470479106
##########
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:
I've got this down to near-equal by introducing a pointer-indirection to
the map and processing it in place anyway, but this probably defeats the
purpose. (Let me join the quick-bench party! :smile: )
https://quick-bench.com/q/7kxa6NSSuo9Dki-J0Mllh3vABeQ
----------------------------------------------------------------
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]