1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +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:
Juan Linietsky
2017-11-25 00:07:54 -03:00
parent 7dfba3cda9
commit bc2e8d99e5
62 changed files with 148 additions and 147 deletions

View File

@@ -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;