]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: avoid `-Wunused-but-set-variable` warning 35912/head
authorKefu Chai <kchai@redhat.com>
Fri, 3 Jul 2020 08:57:56 +0000 (16:57 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 3 Jul 2020 09:15:13 +0000 (17:15 +0800)
in release build, `found` is not used at all. but GCC complains with a
`-Wunused-but-set-variable` warning.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/osd/heartbeat.cc

index c36af322acd7e9bc03883caa4dc5787cfe504ba0..3a33d7f93fbc759c74213531315ad224e8ea74a5 100644 (file)
@@ -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);
 }