diff options
Diffstat (limited to 'core/object/class_db.cpp')
-rw-r--r-- | core/object/class_db.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/core/object/class_db.cpp b/core/object/class_db.cpp index 876635529c..7ea26c3fc5 100644 --- a/core/object/class_db.cpp +++ b/core/object/class_db.cpp @@ -425,8 +425,8 @@ uint32_t ClassDB::get_api_hash(APIType p_api) { for (const StringName &F : snames) { MethodInfo &mi = t->signal_map[F]; hash = hash_murmur3_one_64(F.hash(), hash); - for (int i = 0; i < mi.arguments.size(); i++) { - hash = hash_murmur3_one_64(mi.arguments[i].type, hash); + for (const PropertyInfo &pi : mi.arguments) { + hash = hash_murmur3_one_64(pi.type, hash); } } } @@ -1554,7 +1554,7 @@ bool ClassDB::get_property(Object *p_object, const StringName &p_property, Varia } // The "free()" method is special, so we assume it exists and return a Callable. - if (p_property == CoreStringNames::get_singleton()->_free) { + if (p_property == CoreStringName(free_)) { r_value = Callable(p_object, p_property); return true; } @@ -1856,8 +1856,9 @@ void ClassDB::add_virtual_method(const StringName &p_class, const MethodInfo &p_ if (p_arg_names.size() != mi.arguments.size()) { WARN_PRINT("Mismatch argument name count for virtual method: " + String(p_class) + "::" + p_method.name); } else { - for (int i = 0; i < p_arg_names.size(); i++) { - mi.arguments[i].name = p_arg_names[i]; + List<PropertyInfo>::Iterator itr = mi.arguments.begin(); + for (int i = 0; i < p_arg_names.size(); ++itr, ++i) { + itr->name = p_arg_names[i]; } } } |