mirror of
https://github.com/godotengine/godot.git
synced 2026-03-07 21:41:07 +00:00
Made Vector::ptrw explicit for writing, compiler was sometimes using the wrong function,
leading to unnecesary copy on writes and reduced performance.
This commit is contained in:
parent
7dfba3cda9
commit
bc2e8d99e5
62 changed files with 148 additions and 147 deletions
|
|
@ -71,7 +71,7 @@ StringBuffer &StringBuffer::reserve(int p_size) {
|
|||
bool need_copy = string_length > 0 && buffer.empty();
|
||||
buffer.resize(next_power_of_2(p_size));
|
||||
if (need_copy) {
|
||||
memcpy(buffer.ptr(), short_buffer, string_length * sizeof(CharType));
|
||||
memcpy(buffer.ptrw(), short_buffer, string_length * sizeof(CharType));
|
||||
}
|
||||
|
||||
return *this;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue