Skip to content

Commit

Permalink
Give in to the linter on assignment expression ;P.
Browse files Browse the repository at this point in the history
  • Loading branch information
saurik committed Feb 26, 2024
1 parent 74e48c1 commit de7e947
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions p2p/source/buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -817,13 +817,15 @@ class Flat final :
Flat(const Buffer &buffer) :
data_(nullptr)
{
if ((copy_ = !buffer.each([&](const uint8_t *data, size_t size) {
copy_ = !buffer.each([&](const uint8_t *data, size_t size) {
if (data_ != nullptr)
return false;
size_ = size;
data_ = data;
return true;
}))) {
});

if (copy_) {
size_ = buffer.size();
// NOLINTNEXTLINE(cppcoreguidelines-owning-memory)
const auto data(new uint8_t[size_]);
Expand Down

0 comments on commit de7e947

Please sign in to comment.