summaryrefslogtreecommitdiff
path: root/core/string/translation.cpp
diff options
context:
space:
mode:
authorAaron Record <aaronjrecord@gmail.com>2022-05-18 17:43:40 -0600
committerAaron Record <aaronjrecord@gmail.com>2022-05-19 12:09:16 +0200
commit900c676b0282bed83d00834e3c280ac89c2bc94d (patch)
treeb6bf869a55440a666f4bcc17d5e9cd93ff26dbdc /core/string/translation.cpp
parent71c40ff4da85a4770958533cdc65f2c9f7ddeaff (diff)
Use range iterators for RBSet in most cases
Diffstat (limited to 'core/string/translation.cpp')
-rw-r--r--core/string/translation.cpp12
1 files changed, 6 insertions, 6 deletions
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<Ref<Translation>>::Element *E = translations.front(); E; E = E->next()) {
- const Ref<Translation> &t = E->get();
+ for (const Ref<Translation> &E : translations) {
+ const Ref<Translation> &t = E;
ERR_FAIL_COND_V(t.is_null(), Array());
String l = t->get_locale();
@@ -530,8 +530,8 @@ Ref<Translation> TranslationServer::get_translation_object(const String &p_local
Ref<Translation> res;
int best_score = 0;
- for (const RBSet<Ref<Translation>>::Element *E = translations.front(); E; E = E->next()) {
- const Ref<Translation> &t = E->get();
+ for (const Ref<Translation> &E : translations) {
+ const Ref<Translation> &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<Ref<Translation>>::Element *E = translations.front(); E; E = E->next()) {
- const Ref<Translation> &t = E->get();
+ for (const Ref<Translation> &E : translations) {
+ const Ref<Translation> &t = E;
ERR_FAIL_COND_V(t.is_null(), p_message);
String l = t->get_locale();