Merge pull request #100314 from Ivorforce/use-string-chr

Optimize `String::chr` to avoid calling `strlen`. Use `String::chr` instead of `String(&chr, 1)` where appropriate.
This commit is contained in:
Thaddeus Crews
2025-03-13 08:57:20 -05:00
4 changed files with 8 additions and 11 deletions

View File

@@ -1603,11 +1603,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";