godotengine / godotengine/godot-cpp

String::operator+= reallocates the whole string, needs a function in the C API for efficiency

Open
#438 0 comments 0 reactions 0 assignees View on GitHub
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.