summaryrefslogtreecommitdiff
path: root/editor/property_editor.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2021-07-24 15:46:25 +0200
committerRémi Verschelde <rverschelde@gmail.com>2021-07-25 12:22:25 +0200
commitac3322b0af8f23e8e2dac8111200bc69b5604c9f (patch)
tree59a079f13b5c03c2dd3328a26c55f3618e6014f6 /editor/property_editor.cpp
parenta0f7f42b842462646281f5c4c9a8db070e034adc (diff)
Use const references where possible for List range iterators
Diffstat (limited to 'editor/property_editor.cpp')
-rw-r--r--editor/property_editor.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp
index 6fc77500c3..7338588d56 100644
--- a/editor/property_editor.cpp
+++ b/editor/property_editor.cpp
@@ -143,7 +143,7 @@ void CustomPropertyEditor::_menu_option(int p_which) {
}
Set<String> valid_extensions;
- for (String &E : extensions) {
+ for (const String &E : extensions) {
valid_extensions.insert(E);
}
@@ -179,7 +179,7 @@ void CustomPropertyEditor::_menu_option(int p_which) {
res_orig->get_property_list(&property_list);
List<Pair<String, Variant>> propvalues;
- for (PropertyInfo &pi : property_list) {
+ for (const PropertyInfo &pi : property_list) {
Pair<String, Variant> p;
if (pi.usage & PROPERTY_USAGE_STORAGE) {
p.first = pi.name;
@@ -197,7 +197,7 @@ void CustomPropertyEditor::_menu_option(int p_which) {
ERR_FAIL_COND(res.is_null());
- for (Pair<String, Variant> &p : propvalues) {
+ for (const Pair<String, Variant> &p : propvalues) {
res->set(p.first, p.second);
}
@@ -1291,7 +1291,7 @@ void CustomPropertyEditor::_action_pressed(int p_which) {
ResourceLoader::get_recognized_extensions_for_type(type, &extensions);
file->clear_filters();
- for (String &E : extensions) {
+ for (const String &E : extensions) {
file->add_filter("*." + E + " ; " + E.to_upper());
}
@@ -1319,7 +1319,7 @@ void CustomPropertyEditor::_action_pressed(int p_which) {
res_orig->get_property_list(&property_list);
List<Pair<String, Variant>> propvalues;
- for (PropertyInfo &pi : property_list) {
+ for (const PropertyInfo &pi : property_list) {
Pair<String, Variant> p;
if (pi.usage & PROPERTY_USAGE_STORAGE) {
p.first = pi.name;
@@ -1333,7 +1333,7 @@ void CustomPropertyEditor::_action_pressed(int p_which) {
ERR_FAIL_COND(res.is_null());
- for (Pair<String, Variant> &p : propvalues) {
+ for (const Pair<String, Variant> &p : propvalues) {
res->set(p.first, p.second);
}