refactor(asset): Use the proper STL function to 0-fill vector (#138)

This commit is contained in:
Edo 2023-06-29 20:47:24 +02:00 committed by GitHub
parent 799b5d99ae
commit 401ad99dc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,8 +18,7 @@ auto asset::serialize() -> std::vector<u8>
throw std::runtime_error("script file serialize error");
}
data.resize(name.size() + (compressedLen ? compressedLen : len) + bytecodeLen + 13);
std::memset(data.data(), 0, data.size());
data.resize(name.size() + (compressedLen ? compressedLen : len) + bytecodeLen + 13, 0);
auto pos = usize{ 0 };