Skip to content

Commit

Permalink
Initialize accumulating collections to empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
evoskuil committed Jul 2, 2024
1 parent 2695bba commit 60f68cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/bitcoin/system/impl/stream/streamers/byte_reader.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ data_chunk byte_reader<IStream>::read_bytes() NOEXCEPT
return {};

// This will always produce at least one (zero) terminating byte.
data_chunk out;
data_chunk out{};
while (valid())
out.push_back(read_byte());

Expand Down Expand Up @@ -325,7 +325,7 @@ std::string byte_reader<IStream>::read_string_buffer(size_t size) NOEXCEPT
return {};

// This will produce one (zero) terminating byte if size exceeds available.
std::string out;
std::string out{};
out.reserve(add1(size));
while (!is_zero(size--) && valid())
out.push_back(read_byte());
Expand Down

0 comments on commit 60f68cf

Please sign in to comment.