summaryrefslogtreecommitdiffstats
path: root/core/string
diff options
context:
space:
mode:
Diffstat (limited to 'core/string')
-rw-r--r--core/string/string_name.cpp3
-rw-r--r--core/string/translation_server.cpp5
2 files changed, 6 insertions, 2 deletions
diff --git a/core/string/string_name.cpp b/core/string/string_name.cpp
index 21fe0c8082..0294dbfbbc 100644
--- a/core/string/string_name.cpp
+++ b/core/string/string_name.cpp
@@ -255,11 +255,10 @@ StringName::StringName(const StringName &p_name) {
}
void StringName::assign_static_unique_class_name(StringName *ptr, const char *p_name) {
- mutex.lock();
+ MutexLock lock(mutex);
if (*ptr == StringName()) {
*ptr = StringName(p_name, true);
}
- mutex.unlock();
}
StringName::StringName(const char *p_name, bool p_static) {
diff --git a/core/string/translation_server.cpp b/core/string/translation_server.cpp
index 6e784881d0..4ac79ad10a 100644
--- a/core/string/translation_server.cpp
+++ b/core/string/translation_server.cpp
@@ -284,6 +284,11 @@ String TranslationServer::_standardize_locale(const String &p_locale, bool p_add
}
int TranslationServer::compare_locales(const String &p_locale_a, const String &p_locale_b) const {
+ if (p_locale_a == p_locale_b) {
+ // Exact match.
+ return 10;
+ }
+
String locale_a = _standardize_locale(p_locale_a, true);
String locale_b = _standardize_locale(p_locale_b, true);