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 11:58:10 UTC

[GitHub] [nifi-minifi-cpp] lordgamez 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

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



##########
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:
       It might be safer to only capture uuid by reference if this changes in the future




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