[RawFile]: Remove copy & pasted code

This commit is contained in:
Edo 2022-12-01 14:55:25 +00:00 committed by GitHub
parent d7afbd72e1
commit ee2d12e404
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,7 +25,7 @@ namespace Assets
// Only save the compressed buffer if we gained space // Only save the compressed buffer if we gained space
if (compressedData.size() < rawFile.getBuffer().size()) if (compressedData.size() < rawFile.getBuffer().size())
{ {
asset->buffer = builder->getAllocator()->duplicateString(compressedData); asset->buffer = builder->getAllocator()->allocateArray<char>(compressedData.size());
std::memcpy(const_cast<char*>(asset->buffer), compressedData.data(), compressedData.size()); std::memcpy(const_cast<char*>(asset->buffer), compressedData.data(), compressedData.size());
asset->compressedLen = static_cast<int>(compressedData.size()); asset->compressedLen = static_cast<int>(compressedData.size());
} }