1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Rename String::resize to resize_uninitialized, to better communicate to callers that new characters must be initialized.

This commit is contained in:
Lukas Tenbrink
2025-05-28 20:33:21 +02:00
parent 51b0379e55
commit b13a0e1834
26 changed files with 103 additions and 98 deletions

View File

@@ -58,7 +58,7 @@ bool is_operator_char(unsigned char c) {
String remove_spaces(String &p_str) {
String res;
// Result is guaranteed to not be longer than the input.
res.resize(p_str.size());
res.resize_uninitialized(p_str.size());
int wp = 0;
char32_t last = 0;
bool has_removed = false;
@@ -82,7 +82,7 @@ String remove_spaces(String &p_str) {
last = c;
}
}
res.resize(wp);
res.resize_uninitialized(wp);
return res;
}