From 900c676b0282bed83d00834e3c280ac89c2bc94d Mon Sep 17 00:00:00 2001 From: Aaron Record Date: Wed, 18 May 2022 17:43:40 -0600 Subject: Use range iterators for RBSet in most cases --- core/string/translation.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'core/string/translation.cpp') diff --git a/core/string/translation.cpp b/core/string/translation.cpp index c64f815563..cba2f09022 100644 --- a/core/string/translation.cpp +++ b/core/string/translation.cpp @@ -507,8 +507,8 @@ String TranslationServer::get_locale() const { Array TranslationServer::get_loaded_locales() const { Array locales; - for (const RBSet>::Element *E = translations.front(); E; E = E->next()) { - const Ref &t = E->get(); + for (const Ref &E : translations) { + const Ref &t = E; ERR_FAIL_COND_V(t.is_null(), Array()); String l = t->get_locale(); @@ -530,8 +530,8 @@ Ref TranslationServer::get_translation_object(const String &p_local Ref res; int best_score = 0; - for (const RBSet>::Element *E = translations.front(); E; E = E->next()) { - const Ref &t = E->get(); + for (const Ref &E : translations) { + const Ref &t = E; ERR_FAIL_COND_V(t.is_null(), nullptr); String l = t->get_locale(); @@ -599,8 +599,8 @@ StringName TranslationServer::_get_message_from_translations(const StringName &p StringName res; int best_score = 0; - for (const RBSet>::Element *E = translations.front(); E; E = E->next()) { - const Ref &t = E->get(); + for (const Ref &E : translations) { + const Ref &t = E; ERR_FAIL_COND_V(t.is_null(), p_message); String l = t->get_locale(); -- cgit v1.2.3