Skip to content

Commit

Permalink
Merge pull request godotengine#98301 from aaronp64/gdscript_validate_…
Browse files Browse the repository at this point in the history
…property

Avoid unnecessary `Dictionary` conversions in `GDScriptInstance::validate_property`
  • Loading branch information
Repiteo committed Oct 30, 2024
2 parents 598cfbd + aa1d469 commit 8004c75
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/gdscript/gdscript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1862,14 +1862,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) {
Expand Down

0 comments on commit 8004c75

Please sign in to comment.