godotengine / godotengine/godot-cpp
String::operator+= reallocates the whole string, needs a function in the C API for efficiency
Open
enhancement
- Dominant language
- C++
- Stars
- 2.7k
- Forks
- 809
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 8
Description
Currently `String::operator+=` does not actually run the `+=` engine operator. Instead, it performs an `operator+` behind the scenes, creating an entire new string by copy, and then assigning it it to the current one, dropping its previous value as well.
This isn't very efficient when composing large amounts of text. However, the C API doesn't seem to expose a function properly implementing that. So we may ask for it in the engine.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.