diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-07-25 12:52:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-25 12:52:58 +0200 |
commit | ff0b5f8fa1be4ccd5b8de1d9d49f8a4b71439f63 (patch) | |
tree | 42543cc85d27d2c8692a2ced4bac5c537e402004 /modules/gdscript/gdscript.cpp | |
parent | 2f221e5fd507b176590bda52d08e499629ce7761 (diff) | |
parent | ac3322b0af8f23e8e2dac8111200bc69b5604c9f (diff) |
Merge pull request #50809 from akien-mga/iterators-const-references
Diffstat (limited to 'modules/gdscript/gdscript.cpp')
-rw-r--r-- | modules/gdscript/gdscript.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index 79cc90b92f..b3975fa95c 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -291,7 +291,7 @@ void GDScript::_get_script_property_list(List<PropertyInfo> *r_list, bool p_incl sptr = sptr->_base; } - for (PropertyInfo &E : props) { + for (const PropertyInfo &E : props) { r_list->push_back(E); } } @@ -401,7 +401,7 @@ void GDScript::_update_exports_values(Map<StringName, Variant> &values, List<Pro values[E->key()] = E->get(); } - for (PropertyInfo &E : members_cache) { + for (const PropertyInfo &E : members_cache) { propnames.push_back(E); } } @@ -861,8 +861,7 @@ Error GDScript::reload(bool p_keep_state) { } } #ifdef DEBUG_ENABLED - for (const GDScriptWarning &E : parser.get_warnings()) { - const GDScriptWarning &warning = E; + for (const GDScriptWarning &warning : parser.get_warnings()) { if (EngineDebugger::is_active()) { Vector<ScriptLanguage::StackInfo> si; EngineDebugger::get_script_debugger()->send_error("", get_path(), warning.start_line, warning.get_name(), warning.get_message(), ERR_HANDLER_WARNING, si); @@ -1445,7 +1444,7 @@ void GDScriptInstance::get_property_list(List<PropertyInfo> *p_properties) const sptr = sptr->_base; } - for (PropertyInfo &E : props) { + for (const PropertyInfo &E : props) { p_properties->push_back(E); } } @@ -1661,7 +1660,7 @@ void GDScriptLanguage::init() { List<Engine::Singleton> singletons; Engine::get_singleton()->get_singletons(&singletons); - for (Engine::Singleton &E : singletons) { + for (const Engine::Singleton &E : singletons) { _add_global(E.name, E.ptr); } |