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 /core/string/translation_po.cpp | |
parent | 2f221e5fd507b176590bda52d08e499629ce7761 (diff) | |
parent | ac3322b0af8f23e8e2dac8111200bc69b5604c9f (diff) | |
download | redot-engine-ff0b5f8fa1be4ccd5b8de1d9d49f8a4b71439f63.tar.gz |
Merge pull request #50809 from akien-mga/iterators-const-references
Diffstat (limited to 'core/string/translation_po.cpp')
-rw-r--r-- | core/string/translation_po.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/string/translation_po.cpp b/core/string/translation_po.cpp index afd3b76588..1da00aa54b 100644 --- a/core/string/translation_po.cpp +++ b/core/string/translation_po.cpp @@ -47,7 +47,7 @@ void TranslationPO::print_translation_map() { List<StringName> context_l; translation_map.get_key_list(&context_l); - for (StringName &ctx : context_l) { + for (const StringName &ctx : context_l) { file->store_line(" ===== Context: " + String::utf8(String(ctx).utf8()) + " ===== "); const HashMap<StringName, Vector<StringName>> &inner_map = translation_map[ctx]; @@ -73,7 +73,7 @@ Dictionary TranslationPO::_get_messages() const { List<StringName> context_l; translation_map.get_key_list(&context_l); - for (StringName &ctx : context_l) { + for (const StringName &ctx : context_l) { const HashMap<StringName, Vector<StringName>> &id_str_map = translation_map[ctx]; Dictionary d2; @@ -96,7 +96,7 @@ void TranslationPO::_set_messages(const Dictionary &p_messages) { List<Variant> context_l; p_messages.get_key_list(&context_l); - for (Variant &ctx : context_l) { + for (const Variant &ctx : context_l) { const Dictionary &id_str_map = p_messages[ctx]; HashMap<StringName, Vector<StringName>> temp_map; @@ -118,7 +118,7 @@ Vector<String> TranslationPO::_get_message_list() const { get_message_list(&msgs); Vector<String> v; - for (StringName &E : msgs) { + for (const StringName &E : msgs) { v.push_back(E); } @@ -278,7 +278,7 @@ void TranslationPO::get_message_list(List<StringName> *r_messages) const { List<StringName> context_l; translation_map.get_key_list(&context_l); - for (StringName &E : context_l) { + for (const StringName &E : context_l) { if (String(E) != "") { continue; } @@ -297,7 +297,7 @@ int TranslationPO::get_message_count() const { translation_map.get_key_list(&context_l); int count = 0; - for (StringName &E : context_l) { + for (const StringName &E : context_l) { count += translation_map[E].size(); } return count; |