mirror of
https://github.com/WiVRn/WiVRn.git
synced 2026-11-20 09:01:39 -08:00
Replace resize + memcpy by insert in serialization
This commit is contained in:
1 parent
895b546d25
commit
b253ce0485
1 file changed
+2
-3
@@ -118,9 +118,8 @@ public:
|
||||
|
||||
void write(const void * data, size_t size)
|
||||
{
|
||||
size_t index = buffer.size();
|
||||
buffer.resize(index + size);
|
||||
memcpy(&buffer[index], data, size);
|
||||
auto d = (uint8_t *)data;
|
||||
buffer.insert(buffer.end(), d, d + size);
|
||||
std::get<size_t>(spans.back()) += size;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user