mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +00:00
Avoid unnecessary Dictionary conversions in GDScriptInstance::validate_property
Updated GDScriptInstance::validate_property to only convert PropertyInfo to Dictionary if _validate_property function is found.
This commit is contained in:
parent
4631a617e5
commit
aa1d469ffb
1 changed files with 3 additions and 3 deletions
|
@ -1835,14 +1835,14 @@ Variant::Type GDScriptInstance::get_property_type(const StringName &p_name, bool
|
|||
}
|
||||
|
||||
void GDScriptInstance::validate_property(PropertyInfo &p_property) const {
|
||||
Variant property = (Dictionary)p_property;
|
||||
const Variant *args[1] = { &property };
|
||||
|
||||
const GDScript *sptr = script.ptr();
|
||||
while (sptr) {
|
||||
if (likely(sptr->valid)) {
|
||||
HashMap<StringName, GDScriptFunction *>::ConstIterator E = sptr->member_functions.find(GDScriptLanguage::get_singleton()->strings._validate_property);
|
||||
if (E) {
|
||||
Variant property = (Dictionary)p_property;
|
||||
const Variant *args[1] = { &property };
|
||||
|
||||
Callable::CallError err;
|
||||
Variant ret = E->value->call(const_cast<GDScriptInstance *>(this), args, 1, err);
|
||||
if (err.error == Callable::CallError::CALL_OK) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue