]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: simplify iteration code
authorPatrick Donnelly <pdonnell@redhat.com>
Fri, 18 Nov 2016 18:26:20 +0000 (13:26 -0500)
committerPatrick Donnelly <pdonnell@redhat.com>
Tue, 28 Feb 2017 19:48:26 +0000 (14:48 -0500)
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/mds/MDSMap.cc

index 6a666725b547ed01a9062738143fb934ab0500a0..1e86b5da769cae87ee435a5f9d29481b6ed4099b 100644 (file)
@@ -374,14 +374,12 @@ void MDSMap::get_health(list<pair<health_status_t,string> >& summary,
     }
   }
 
-  map<mds_rank_t, mds_gid_t>::const_iterator u = up.begin();
-  map<mds_rank_t, mds_gid_t>::const_iterator u_end = up.end();
   map<mds_gid_t, mds_info_t>::const_iterator m_end = mds_info.end();
   set<string> laggy;
-  for (; u != u_end; ++u) {
-    map<mds_gid_t, mds_info_t>::const_iterator m = mds_info.find(u->second);
+  for (const auto &u : up) {
+    map<mds_gid_t, mds_info_t>::const_iterator m = mds_info.find(u.second);
     if (m == m_end) {
-      std::cerr << "Up rank " << u->first << " GID " << u->second << " not found!" << std::endl;
+      std::cerr << "Up rank " << u.first << " GID " << u.second << " not found!" << std::endl;
     }
     assert(m != m_end);
     const mds_info_t &mds_info(m->second);