From de7e9479250f773f7caac60ef0ad374bf9b96c6b Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Mon, 26 Feb 2024 09:57:46 +0000 Subject: [PATCH] Give in to the linter on assignment expression ;P. --- p2p/source/buffer.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/p2p/source/buffer.hpp b/p2p/source/buffer.hpp index 073de95f1..e43e3a429 100644 --- a/p2p/source/buffer.hpp +++ b/p2p/source/buffer.hpp @@ -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_]);