mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Merge pull request #108504 from precup/optimize-duplicate
Avoid unnecessary copy in ClassDB::get_property_list
This commit is contained in:
commit
3fa7c65914
1 changed files with 2 additions and 6 deletions
|
@ -1542,13 +1542,9 @@ void ClassDB::get_property_list(const StringName &p_class, List<PropertyInfo> *p
|
|||
ClassInfo *check = type;
|
||||
while (check) {
|
||||
for (const PropertyInfo &pi : check->property_list) {
|
||||
if (p_validator) {
|
||||
// Making a copy as we may modify it.
|
||||
PropertyInfo pi_mut = pi;
|
||||
p_validator->validate_property(pi_mut);
|
||||
p_list->push_back(pi_mut);
|
||||
} else {
|
||||
p_list->push_back(pi);
|
||||
if (p_validator) {
|
||||
p_validator->validate_property(p_list->back()->get());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue