Rename String::resize to resize_uninitialized, to better communicate to callers that new characters must be initialized.
This commit is contained in:
parent
51b0379e55
commit
b13a0e1834
26 changed files with 103 additions and 98 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue