Only recurse depth wise in `Tree::_count_selected_items`

(cherry picked from commit 43038bbfcb)
This commit is contained in:
ACB 2024-02-04 14:21:03 +01:00 committed by Rémi Verschelde
parent 4e5b545c04
commit fb63404aad
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 2 additions and 6 deletions

View File

@ -2540,12 +2540,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;