mirror of
https://github.com/godotengine/godot.git
synced 2025-10-25 18:54:43 +00:00
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
|
|
@ -1337,7 +1337,7 @@ void GDScriptTokenizerText::check_indent() {
|
|||
}
|
||||
|
||||
String GDScriptTokenizerText::_get_indent_char_name(char32_t ch) {
|
||||
ERR_FAIL_COND_V(ch != ' ' && ch != '\t', String(&ch, 1).c_escape());
|
||||
ERR_FAIL_COND_V(ch != ' ' && ch != '\t', String::chr(ch).c_escape());
|
||||
|
||||
return ch == ' ' ? "space" : "tab";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue