summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_engine/dag/dag.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildtool/execution_engine/dag/dag.hpp')
-rw-r--r--src/buildtool/execution_engine/dag/dag.hpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/buildtool/execution_engine/dag/dag.hpp b/src/buildtool/execution_engine/dag/dag.hpp
index 500ff0fc..bcc0cd48 100644
--- a/src/buildtool/execution_engine/dag/dag.hpp
+++ b/src/buildtool/execution_engine/dag/dag.hpp
@@ -163,6 +163,7 @@ class DirectedAcyclicGraph {
protected:
template <typename T_Node>
+ // NOLINTNEXTLINE(misc-no-recursion)
[[nodiscard]] static auto check_validity(
gsl::not_null<T_Node*> node) noexcept -> bool {
// Check node-specified validity (e.g. bipartiteness requirements)
@@ -560,13 +561,13 @@ class DependencyGraph : DirectedAcyclicGraph {
-> std::optional<ActionIdentifier>;
[[nodiscard]] auto IsValid() const noexcept -> bool {
- for (auto const& node : artifact_nodes_) {
- if (!DirectedAcyclicGraph::check_validity<
- std::remove_reference_t<decltype(*node)>>(&(*node))) {
- return false;
- }
- }
- return true;
+ return std::all_of(
+ artifact_nodes_.begin(),
+ artifact_nodes_.end(),
+ [](auto const& node) {
+ return DirectedAcyclicGraph::check_validity<
+ std::remove_reference_t<decltype(*node)>>(&(*node));
+ });
}
private: