summaryrefslogtreecommitdiff
path: root/editor/script_create_dialog.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/script_create_dialog.cpp
parenta0f7f42b842462646281f5c4c9a8db070e034adc (diff)
Use const references where possible for List range iterators
Diffstat (limited to 'editor/script_create_dialog.cpp')
-rw-r--r--editor/script_create_dialog.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/editor/script_create_dialog.cpp b/editor/script_create_dialog.cpp
index 90481b2107..9a4b38db74 100644
--- a/editor/script_create_dialog.cpp
+++ b/editor/script_create_dialog.cpp
@@ -205,7 +205,7 @@ String ScriptCreateDialog::_validate_path(const String &p_path, bool p_file_must
bool found = false;
bool match = false;
int index = 0;
- for (String &E : extensions) {
+ for (const String &E : extensions) {
if (E.nocasecmp_to(extension) == 0) {
//FIXME (?) - changing language this way doesn't update controls, needs rework
//language_menu->select(index); // change Language option by extension
@@ -373,7 +373,7 @@ void ScriptCreateDialog::_lang_changed(int l) {
ScriptServer::get_language(m)->get_recognized_extensions(&extensions);
}
- for (String &E : extensions) {
+ for (const String &E : extensions) {
if (E.nocasecmp_to(extension) == 0) {
path = path.get_basename() + selected_ext;
_path_changed(path);
@@ -534,7 +534,7 @@ void ScriptCreateDialog::_browse_path(bool browse_parent, bool p_save) {
int lang = language_menu->get_selected();
ScriptServer::get_language(lang)->get_recognized_extensions(&extensions);
- for (String &E : extensions) {
+ for (const String &E : extensions) {
file_browse->add_filter("*." + E);
}