From ac3322b0af8f23e8e2dac8111200bc69b5604c9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sat, 24 Jul 2021 15:46:25 +0200 Subject: Use const references where possible for List range iterators --- tests/test_class_db.h | 6 +++--- tests/test_math.cpp | 2 +- tests/test_render.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/test_class_db.h b/tests/test_class_db.h index e67b2de66a..ea680da5d6 100644 --- a/tests/test_class_db.h +++ b/tests/test_class_db.h @@ -559,7 +559,7 @@ void add_exposed_classes(Context &r_context) { ClassDB::get_method_list(class_name, &method_list, true); method_list.sort(); - for (MethodInfo &E : method_list) { + for (const MethodInfo &E : method_list) { const MethodInfo &method_info = E; int argc = method_info.arguments.size(); @@ -827,7 +827,7 @@ void add_global_enums(Context &r_context) { } } - for (EnumData &E : r_context.global_enums) { + for (const EnumData &E : r_context.global_enums) { r_context.enum_types.push_back(E.name); } } @@ -838,7 +838,7 @@ void add_global_enums(Context &r_context) { hardcoded_enums.push_back("Vector2i.Axis"); hardcoded_enums.push_back("Vector3.Axis"); hardcoded_enums.push_back("Vector3i.Axis"); - for (StringName &E : hardcoded_enums) { + for (const StringName &E : hardcoded_enums) { // These enums are not generated and must be written manually (e.g.: Vector3.Axis) // Here, we assume core types do not begin with underscore r_context.enum_types.push_back(E); diff --git a/tests/test_math.cpp b/tests/test_math.cpp index d2960333cc..d0b9fdef4b 100644 --- a/tests/test_math.cpp +++ b/tests/test_math.cpp @@ -549,7 +549,7 @@ MainLoop *test() { List tl; ClassDB::get_class_list(&tl); - for (StringName &E : tl) { + for (const StringName &E : tl) { Vector m5b = E.operator String().md5_buffer(); hashes.push_back(hashes.size()); } diff --git a/tests/test_render.cpp b/tests/test_render.cpp index 66fd04dbdd..00ce187847 100644 --- a/tests/test_render.cpp +++ b/tests/test_render.cpp @@ -210,7 +210,7 @@ public: //return quit; - for (InstanceInfo &E : instances) { + for (const InstanceInfo &E : instances) { Transform3D pre(Basis(E.rot_axis, ofs), Vector3()); vs->instance_set_transform(E.instance, pre * E.base); /* -- cgit v1.2.3