Perform aggregate zero-init instead of .fill(0) where appropriate.
All checks were successful
Chaos Ci / test-and-benchmark (push) Successful in 1m50s

Simpler and more consistent code.
This commit is contained in:
hashlag
2026-02-05 00:40:55 +03:00
parent ed22d29af0
commit 95e74db6ec
4 changed files with 17 additions and 38 deletions

View File

@@ -46,8 +46,7 @@ TEST(DesCryptTests, EncryptTest)
std::array<uint8_t, DesCrypt::BlockSize> operator()(const std::array<uint8_t, DesCrypt::BlockSize> & data,
const std::array<uint8_t, 8> & key) const
{
std::array<uint8_t, DesCrypt::BlockSize> result;
result.fill(0);
std::array<uint8_t, DesCrypt::BlockSize> result = {};
DesCrypt::Key desKey(key.begin(), key.end());
DesCrypt::DesEncryptor enc(desKey);
@@ -206,8 +205,7 @@ TEST(DesCryptTests, DecryptTest)
std::array<uint8_t, DesCrypt::BlockSize> operator()(const std::array<uint8_t, DesCrypt::BlockSize> & data,
const std::array<uint8_t, 8> & key) const
{
std::array<uint8_t, DesCrypt::BlockSize> result;
result.fill(0);
std::array<uint8_t, DesCrypt::BlockSize> result = {};
DesCrypt::Key desKey(key.begin(), key.end());
DesCrypt::DesDecryptor dec(desKey);