diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-11-25 00:07:54 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-11-25 00:09:40 -0300 |
commit | bc2e8d99e5ae0dbd69e712cc71da3033f5f30139 (patch) | |
tree | d836011e3d5873e3ceea328ea3100f3c7719ab99 /editor/fileserver | |
parent | 7dfba3cda9f13427f9f10a6eefbec52aef62274c (diff) |
Made Vector::ptrw explicit for writing, compiler was sometimes using the wrong function,
leading to unnecesary copy on writes and reduced performance.
Diffstat (limited to 'editor/fileserver')
-rw-r--r-- | editor/fileserver/editor_file_server.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/editor/fileserver/editor_file_server.cpp b/editor/fileserver/editor_file_server.cpp index fccf7c323c..ad035b48f3 100644 --- a/editor/fileserver/editor_file_server.cpp +++ b/editor/fileserver/editor_file_server.cpp @@ -31,7 +31,6 @@ #include "../editor_settings.h" #include "io/marshalls.h" -#include "io/marshalls.h" //#define DEBUG_PRINT(m_p) print_line(m_p) #define DEBUG_TIME(m_what) printf("MS: %s - %lu\n", m_what, OS::get_singleton()->get_ticks_usec()); @@ -240,7 +239,7 @@ void EditorFileServer::_subthread_start(void *s) { cd->files[id]->seek(offset); Vector<uint8_t> buf; buf.resize(blocklen); - int read = cd->files[id]->get_buffer(buf.ptr(), blocklen); + int read = cd->files[id]->get_buffer(buf.ptrw(), blocklen); ERR_CONTINUE(read < 0); print_line("GET BLOCK - offset: " + itos(offset) + ", blocklen: " + itos(blocklen)); |