From 401ad99dc37c985b6f81e08f8b4322c28eb86c7d Mon Sep 17 00:00:00 2001 From: Edo Date: Thu, 29 Jun 2023 20:47:24 +0200 Subject: [PATCH] refactor(asset): Use the proper STL function to 0-fill vector (#138) --- src/gsc/common/asset.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gsc/common/asset.cpp b/src/gsc/common/asset.cpp index de8d2804..b2f780be 100644 --- a/src/gsc/common/asset.cpp +++ b/src/gsc/common/asset.cpp @@ -18,8 +18,7 @@ auto asset::serialize() -> std::vector 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 };