MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / is_recursive

Method is_recursive

src/expr/src/relation.rs:2014–2023  ·  view source on GitHub ↗

True when `expr` contains a `LetRec` AST node.

(self: &MirRelationExpr)

Source from the content-addressed store, hash-verified

2012impl MirRelationExpr {
2013 /// True when `expr` contains a `LetRec` AST node.
2014 pub fn is_recursive(self: &MirRelationExpr) -> bool {
2015 let mut worklist = vec![self];
2016 while let Some(expr) = worklist.pop() {
2017 if let MirRelationExpr::LetRec { .. } = expr {
2018 return true;
2019 }
2020 worklist.extend(expr.children());
2021 }
2022 false
2023 }
2024
2025 /// Return the number of sub-expressions in the tree (including self).
2026 pub fn size(&self) -> usize {

Callers 2

enforce_linear_chainsFunction · 0.45
actionMethod · 0.45

Calls 3

childrenMethod · 0.65
popMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected