lordgamez commented on code in PR #1354:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1354#discussion_r927388710


##########
libminifi/src/core/Processor.cpp:
##########
@@ -290,32 +289,16 @@ bool Processor::partOfCycle(Connection* conn) {
 }
 
 bool Processor::isThrottledByBackpressure() const {
-  bool isThrottledByOutgoing = ([&] {
-    for (auto &outIt : outgoing_connections_) {
-      for (auto &out : outIt.second) {
-        auto connection = dynamic_cast<Connection*>(out);
-        if (!connection) {
-          continue;
-        }
-        if (connection->isFull()) {
-          return true;
-        }
-      }
-    }
-    return false;
-  })();
-  bool isForcedByIncomingCycle = ([&] {
-    for (auto &inConn : incoming_connections_) {
-      auto connection = dynamic_cast<Connection*>(inConn);
-      if (!connection) {
-        continue;
-      }
-      if (partOfCycle(connection) && connection->isFull()) {
-        return true;
-      }
-    }
-    return false;
-  })();
+  bool isThrottledByOutgoing = ranges::any_of(outgoing_connections_, [&](auto& 
outIt) {
+    return ranges::any_of(outIt.second, [&](auto* out) {
+      auto connection = dynamic_cast<Connection*>(out);
+      return connection && connection->isFull();
+    });
+  });
+  bool isForcedByIncomingCycle = ranges::any_of(incoming_connections_, 
[&](auto& inConn) {
+    auto connection = dynamic_cast<Connection*>(inConn);
+    return connection && partOfCycle(connection) && connection->isFull();
+  });

Review Comment:
   Updated in c29515bfaea390b4b05c1796e962e6c02b9c6cf0



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