1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

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

This commit is contained in:
Lukas Tenbrink
2024-12-12 14:09:47 +01:00
parent 24d74510e5
commit 2aeca3e885
4 changed files with 8 additions and 11 deletions

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";