mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Merge pull request #108507 from dementive/optimize-scene-tree-groups
Optimize scene tree groups
This commit is contained in:
commit
7d5034c50a
8 changed files with 35 additions and 43 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue