MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / RecursiveDependencyDepth

Method RecursiveDependencyDepth

eval/compiler/flat_expr_builder_extensions.cc:101–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101absl::optional<int> Subexpression::RecursiveDependencyDepth() const {
102 auto* tree = absl::get_if<TreePlan>(&program_);
103 int depth = 0;
104 if (tree == nullptr) {
105 return absl::nullopt;
106 }
107 for (const auto& element : *tree) {
108 auto* subexpression = absl::get_if<Subexpression*>(&element);
109 if (subexpression == nullptr) {
110 return absl::nullopt;
111 }
112 if (!(*subexpression)->IsRecursive()) {
113 return absl::nullopt;
114 }
115 depth = std::max(depth, (*subexpression)->recursive_program().depth);
116 }
117 return depth;
118}
119
120std::vector<std::unique_ptr<DirectExpressionStep>>
121Subexpression::ExtractRecursiveDependencies() const {

Callers 2

RecursionEligibleMethod · 0.80
TEST_FFunction · 0.80

Calls 1

IsRecursiveMethod · 0.80

Tested by 1

TEST_FFunction · 0.64