mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +00:00
Speed up deletion in large trees via the Scene Tree Dock
This commit is contained in:
parent
5950fca36c
commit
1ad3b9986e
4 changed files with 34 additions and 21 deletions
|
|
@ -150,7 +150,7 @@ private:
|
|||
TreeItem *first_child = nullptr;
|
||||
TreeItem *last_child = nullptr;
|
||||
|
||||
Vector<TreeItem *> children_cache;
|
||||
LocalVector<TreeItem *> children_cache;
|
||||
bool is_root = false; // For tree root.
|
||||
Tree *tree = nullptr; // Tree (for reference).
|
||||
|
||||
|
|
@ -169,7 +169,7 @@ private:
|
|||
if (children_cache.is_empty()) {
|
||||
TreeItem *c = first_child;
|
||||
while (c) {
|
||||
children_cache.append(c);
|
||||
children_cache.push_back(c);
|
||||
c = c->next;
|
||||
}
|
||||
}
|
||||
|
|
@ -201,7 +201,7 @@ private:
|
|||
}
|
||||
if (parent) {
|
||||
if (!parent->children_cache.is_empty()) {
|
||||
parent->children_cache.remove_at(get_index());
|
||||
parent->children_cache.erase(this);
|
||||
}
|
||||
if (parent->first_child == this) {
|
||||
parent->first_child = next;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue