We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4488331 commit a59043cCopy full SHA for a59043c
deep_causality_ast/src/const_tree/accessors.rs
@@ -78,12 +78,8 @@ impl<T> ConstTree<T> {
78
let mut max_depth = 0;
79
let mut queue = VecDeque::new();
80
81
- if !self.is_leaf() {
82
- // Push the root node with depth 1 to start.
83
- queue.push_back((self, 1));
84
- } else {
85
- return 1;
86
- }
+ // Always start with the root node at depth 1.
+ queue.push_back((self, 1));
87
88
while let Some((current_node, current_depth)) = queue.pop_front() {
89
max_depth = max_depth.max(current_depth);
0 commit comments