From e2b1c71982a0f050d827fd012f760faedb59d636 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sun, 28 Nov 2021 08:05:44 -0600 Subject: [PATCH] fix: unused variable warning when building in release mode --- libtransmission/bandwidth.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libtransmission/bandwidth.cc b/libtransmission/bandwidth.cc index da7a4a1fc..1023a95e6 100644 --- a/libtransmission/bandwidth.cc +++ b/libtransmission/bandwidth.cc @@ -120,9 +120,11 @@ void Bandwidth::setParent(Bandwidth* new_parent) if (new_parent != nullptr) { +#ifdef TR_ENABLE_ASSERTS TR_ASSERT(new_parent->parent_ != this); auto& children = new_parent->children_; TR_ASSERT(std::find(std::begin(children), std::end(children), this) == std::end(children)); // not already there +#endif new_parent->children_.push_back(this); this->parent_ = new_parent;