From: Kefu Chai Date: Fri, 3 Jul 2020 08:57:56 +0000 (+0800) Subject: crimson/osd: avoid `-Wunused-but-set-variable` warning X-Git-Tag: v17.0.0~1880^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=0b8cc7ea8bcea4df5c006c9d192c5212ccc60d9f;p=ceph.git crimson/osd: avoid `-Wunused-but-set-variable` warning in release build, `found` is not used at all. but GCC complains with a `-Wunused-but-set-variable` warning. Signed-off-by: Kefu Chai --- diff --git a/src/crimson/osd/heartbeat.cc b/src/crimson/osd/heartbeat.cc index c36af322acd7e..3a33d7f93fbc7 100644 --- a/src/crimson/osd/heartbeat.cc +++ b/src/crimson/osd/heartbeat.cc @@ -196,8 +196,7 @@ Heartbeat::osds_t Heartbeat::get_peers() const void Heartbeat::remove_peer(osd_id_t peer) { - auto found = peers.find(peer); - assert(found != peers.end()); + assert(peers.count(peer) == 1); peers.erase(peer); }