You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 13:10:58 +00:00
Use const references where possible for List range iterators
This commit is contained in:
@@ -1124,7 +1124,7 @@ bool Variant::has_builtin_method_return_value(Variant::Type p_type, const String
|
||||
|
||||
void Variant::get_builtin_method_list(Variant::Type p_type, List<StringName> *p_list) {
|
||||
ERR_FAIL_INDEX(p_type, Variant::VARIANT_MAX);
|
||||
for (StringName &E : builtin_method_names[p_type]) {
|
||||
for (const StringName &E : builtin_method_names[p_type]) {
|
||||
p_list->push_back(E);
|
||||
}
|
||||
}
|
||||
@@ -1188,7 +1188,7 @@ void Variant::get_method_list(List<MethodInfo> *p_list) const {
|
||||
obj->get_method_list(p_list);
|
||||
}
|
||||
} else {
|
||||
for (StringName &E : builtin_method_names[type]) {
|
||||
for (const StringName &E : builtin_method_names[type]) {
|
||||
const VariantBuiltInMethodInfo *method = builtin_method_info[type].lookup_ptr(E);
|
||||
ERR_CONTINUE(!method);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user