From 2e23b7cfba344bd24ae202b26ff280a57748570d Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Thu, 2 Jun 2022 00:28:14 +0100 Subject: Remove redundant initialisations The static buffers here are immediately passed in to be overwritten. --- src/ByteBuffer.cpp | 2 +- src/StringCompression.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ByteBuffer.cpp b/src/ByteBuffer.cpp index af619f26f..46f2ba0d4 100644 --- a/src/ByteBuffer.cpp +++ b/src/ByteBuffer.cpp @@ -556,7 +556,7 @@ bool cByteBuffer::ReadUUID(cUUID & a_Value) { CHECK_THREAD - std::array UUIDBuf = {0}; + std::array UUIDBuf; if (!ReadBuf(UUIDBuf.data(), UUIDBuf.size())) { return false; diff --git a/src/StringCompression.cpp b/src/StringCompression.cpp index d82f45987..6678fe1bd 100644 --- a/src/StringCompression.cpp +++ b/src/StringCompression.cpp @@ -76,7 +76,7 @@ Compression::Result Compression::Compressor::Compress(const void * const Input, { // First see if the stack buffer has enough space: { - Result::Static Buffer = {static_cast(0)}; + Result::Static Buffer; const auto BytesWrittenOut = Algorithm(m_Handle, Input, Size, Buffer.data(), Buffer.size()); if (BytesWrittenOut != 0) @@ -189,7 +189,7 @@ Compression::Result Compression::Extractor::Extract(const ContiguousByteBufferVi { // First see if the stack buffer has enough space: { - Result::Static Buffer = {static_cast(0)}; + Result::Static Buffer; size_t BytesWrittenOut; switch (Algorithm(m_Handle, Input.data(), Input.size(), Buffer.data(), Buffer.size(), &BytesWrittenOut)) -- cgit v1.2.3