Merge pull request #108507 from dementive/optimize-scene-tree-groups

Optimize scene tree groups
This commit is contained in:
Thaddeus Crews 2025-11-14 14:22:57 -06:00
commit 7d5034c50a
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC
8 changed files with 35 additions and 43 deletions

View file

@ -1581,22 +1581,20 @@ Node *SceneTree::get_first_node_in_group(const StringName &p_group) {
return E->value.nodes[0];
}
void SceneTree::get_nodes_in_group(const StringName &p_group, List<Node *> *p_list) {
Vector<Node *> SceneTree::get_nodes_in_group(const StringName &p_group) {
_THREAD_SAFE_METHOD_
HashMap<StringName, Group>::Iterator E = group_map.find(p_group);
if (!E) {
return;
return {};
}
_update_group_order(E->value); //update order just in case
int nc = E->value.nodes.size();
if (nc == 0) {
return;
}
Node **ptr = E->value.nodes.ptrw();
for (int i = 0; i < nc; i++) {
p_list->push_back(ptr[i]);
return {};
}
return E->value.nodes;
}
void SceneTree::_flush_delete_queue() {