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/08/11 12:41:32 UTC

[GitHub] [nifi-minifi-cpp] hunyadi-dev commented on a change in pull request #865: MINIFICPP-1325 - Separate process group processor lookups for IDs and names, allow constructing ID-s from strings

hunyadi-dev commented on a change in pull request #865:
URL: https://github.com/apache/nifi-minifi-cpp/pull/865#discussion_r468548913



##########
File path: libminifi/src/core/ProcessGroup.cpp
##########
@@ -263,26 +263,21 @@ void ProcessGroup::stopProcessing(const std::shared_ptr<TimerDrivenSchedulingAge
   }
 }
 
-std::shared_ptr<Processor> ProcessGroup::findProcessor(utils::Identifier &uuid) {
-  std::lock_guard<std::recursive_mutex> lock(mutex_);
-  std::shared_ptr<Processor> ret = NULL;
-  for (auto processor : processors_) {
-    logger_->log_debug("find processor %s", processor->getName());
+std::shared_ptr<Processor> ProcessGroup::findProcessorById(const utils::Identifier& uuid) const {
+  const auto id_matches = [&] (const std::shared_ptr<Processor>& processor) {

Review comment:
       I disagree, capturing by `&` is safe long as the lambda never outlives its scope.




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