From 4e6efd1b07f1c6d53d226977ddc729333b74306a Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Thu, 15 Jul 2021 23:45:57 -0400 Subject: Use C++ iterators for Lists in many situations --- core/variant/variant_call.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'core/variant/variant_call.cpp') diff --git a/core/variant/variant_call.cpp b/core/variant/variant_call.cpp index 65ad27d0b4..c77a5af6d7 100644 --- a/core/variant/variant_call.cpp +++ b/core/variant/variant_call.cpp @@ -1088,8 +1088,8 @@ bool Variant::has_builtin_method_return_value(Variant::Type p_type, const String void Variant::get_builtin_method_list(Variant::Type p_type, List *p_list) { ERR_FAIL_INDEX(p_type, Variant::VARIANT_MAX); - for (List::Element *E = builtin_method_names[p_type].front(); E; E = E->next()) { - p_list->push_back(E->get()); + for (StringName &E : builtin_method_names[p_type]) { + p_list->push_back(E); } } @@ -1152,12 +1152,12 @@ void Variant::get_method_list(List *p_list) const { obj->get_method_list(p_list); } } else { - for (List::Element *E = builtin_method_names[type].front(); E; E = E->next()) { - const VariantBuiltInMethodInfo *method = builtin_method_info[type].lookup_ptr(E->get()); + for (StringName &E : builtin_method_names[type]) { + const VariantBuiltInMethodInfo *method = builtin_method_info[type].lookup_ptr(E); ERR_CONTINUE(!method); MethodInfo mi; - mi.name = E->get(); + mi.name = E; //return type if (method->has_return_type) { -- cgit v1.2.3