Merge pull request #87943 from 0x0ACB/tree_recursion

Only recurse depth wise in `Tree::_count_selected_items`
This commit is contained in:
Rémi Verschelde 2024-02-05 14:53:46 +01:00
commit 43a8351263
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -2587,12 +2587,8 @@ int Tree::_count_selected_items(TreeItem *p_from) const {
}
}
if (p_from->get_first_child()) {
count += _count_selected_items(p_from->get_first_child());
}
if (p_from->get_next()) {
count += _count_selected_items(p_from->get_next());
for (TreeItem *c = p_from->get_first_child(); c; c = c->get_next()) {
count += _count_selected_items(c);
}
return count;