Merge pull request #88785 from KoBeWi/list_cringe

Fix inefficient list iteration in Node
This commit is contained in:
Rémi Verschelde 2024-02-25 11:50:16 +01:00
commit 81f3d43cc1
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 4 additions and 4 deletions

View File

@ -2963,12 +2963,12 @@ void Node::replace_by(Node *p_node, bool p_keep_groups) {
}
p_node->set_owner(owner);
for (int i = 0; i < owned.size(); i++) {
owned[i]->set_owner(p_node);
for (Node *E : owned) {
E->set_owner(p_node);
}
for (int i = 0; i < owned_by_owner.size(); i++) {
owned_by_owner[i]->set_owner(owner);
for (Node *E : owned_by_owner) {
E->set_owner(owner);
}
p_node->set_scene_file_path(get_scene_file_path());