godot icon indicating copy to clipboard operation
godot copied to clipboard

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

Open Ivorforce opened this issue 1 year ago • 0 comments

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.

Ivorforce avatar Dec 12 '24 13:12 Ivorforce