godot
godot copied to clipboard
Optimize `String::chr` to avoid calling `strlen`. Use `String::chr` instead of `String(&chr, 1)` where appropriate.
This is a small refactor to get rid of 3 uses of String(ptr, len) (which I'm planning to delete entirely, because it's inefficient). I also make String::chr inlineable because the function is trivial, and having it in the cpp file is unnecessary.
It's technically a tiny improvement too since the resulting code is faster and can be better optimized by the compiler. But it should be considered a refactor.