From a385156f8a5758c8f8a2a91f98a39c08bb99b7c4 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 };