Optimize String::chr to avoid calling strlen. Use String::chr instead of String(&chr, 1) where appropriate.
This commit is contained in:
parent
24d74510e5
commit
2aeca3e885
4 changed files with 8 additions and 11 deletions
|
|
@ -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";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue