]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: refactor iterator lookup
authorPatrick Donnelly <pdonnell@redhat.com>
Thu, 9 Sep 2021 23:33:01 +0000 (19:33 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Fri, 17 Sep 2021 01:51:13 +0000 (21:51 -0400)
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 4034fc7c6acbbba90d07e52f4bcd8b6738e47b8c)

src/mds/MDSMap.h

index bb5899c2d0721ca4d46017340520f06ae20d0e14..0e1f839c3a6f9c0cb2083fe8ee1c5aa1cac78492 100644 (file)
@@ -547,10 +547,10 @@ public:
    * Get MDS rank incarnation if the rank is up, else -1
    */
   mds_gid_t get_incarnation(mds_rank_t m) const {
-    std::map<mds_rank_t, mds_gid_t>::const_iterator u = up.find(m);
-    if (u == up.end())
+    auto it = up.find(m);
+    if (it == up.end())
       return MDS_GID_NONE;
-    return (mds_gid_t)get_inc_gid(u->second);
+    return (mds_gid_t)get_inc_gid(it->second);
   }
 
   int get_inc_gid(mds_gid_t gid) const {