summaryrefslogtreecommitdiff
path: root/core/string/translation.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-04-06 15:47:20 +0200
committerGitHub <noreply@github.com>2022-04-06 15:47:20 +0200
commitac591d9904e4e5cf7841b3e79caabf558d37db0e (patch)
tree70f3bd487e91feb4ca777dba214a09b17041da97 /core/string/translation.cpp
parent72407a9cfbd4f58102972c0910429f3ab7006f07 (diff)
parentf851c4aa330e1064a66db50be62db2466f4fb768 (diff)
Merge pull request #59911 from bruvzg/cppcheck_fixes
Diffstat (limited to 'core/string/translation.cpp')
-rw-r--r--core/string/translation.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/string/translation.cpp b/core/string/translation.cpp
index c41828de05..d6d361b5f1 100644
--- a/core/string/translation.cpp
+++ b/core/string/translation.cpp
@@ -891,7 +891,7 @@ String TranslationServer::wrap_with_fakebidi_characters(String &p_message) const
return res;
}
-String TranslationServer::add_padding(String &p_message, int p_length) const {
+String TranslationServer::add_padding(const String &p_message, int p_length) const {
String res;
String prefix = pseudolocalization_prefix;
String suffix;
@@ -921,7 +921,7 @@ const char32_t *TranslationServer::get_accented_version(char32_t p_character) co
}
bool TranslationServer::is_placeholder(String &p_message, int p_index) const {
- return p_message[p_index] == '%' && p_index < p_message.size() - 1 &&
+ return p_index < p_message.size() - 1 && p_message[p_index] == '%' &&
(p_message[p_index + 1] == 's' || p_message[p_index + 1] == 'c' || p_message[p_index + 1] == 'd' ||
p_message[p_index + 1] == 'o' || p_message[p_index + 1] == 'x' || p_message[p_index + 1] == 'X' || p_message[p_index + 1] == 'f');
}