Optimize String::chr to avoid calling strlen. Use String::chr instead of String(&chr, 1) where appropriate.

This commit is contained in:
Lukas Tenbrink committed 2025-01-10 18:06:46 +01:00
1 parent 24d74510e5
commit 2aeca3e885
4 files changed
+8 -11

No files matched your search

-5
View File
@@ -1626,11 +1626,6 @@ String String::to_lower() const {
return lower;
}
String String::chr(char32_t p_char) {
char32_t c[2] = { p_char, 0 };
return String(c);
}
String String::num(double p_num, int p_decimals) {
if (Math::is_nan(p_num)) {
return "nan";