szaszm commented on code in PR #2029:
URL: https://github.com/apache/nifi-minifi-cpp/pull/2029#discussion_r2368628272


##########
extensions/systemd/ConsumeJournald.cpp:
##########
@@ -78,7 +78,7 @@ void ConsumeJournald::onSchedule(core::ProcessContext& 
context, core::ProcessSes
     return process_old_messages ? journal.seekHead() : journal.seekTail();
   };
   worker_->enqueue([this, &seek_default] {
-    const auto cursor = state_manager_->get() | 
utils::transform([](std::unordered_map<std::string, std::string>&& m) { return 
m.at(CURSOR_KEY); });
+    const auto cursor = state_manager_->get() | utils::transform([](const 
std::unordered_map<std::string, std::string>& m) { return m.at(CURSOR_KEY); });

Review Comment:
   why was this changed? we can capture a temporary by either reference type, 
but it's an rvalue, so an rvalue reference seems better fitting. It would allow 
moving out the cursor value if unordered_map had an rvalue qualified overload 
of at.



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

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to