You've already forked godot
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user