From eaa4eee122b810272d459ebb4d66912b5224242d Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Thu, 9 Sep 2021 19:33:01 -0400 Subject: [PATCH] mds: refactor iterator lookup Signed-off-by: Patrick Donnelly (cherry picked from commit 4034fc7c6acbbba90d07e52f4bcd8b6738e47b8c) --- src/mds/MDSMap.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mds/MDSMap.h b/src/mds/MDSMap.h index bb5899c2d0721..0e1f839c3a6f9 100644 --- a/src/mds/MDSMap.h +++ b/src/mds/MDSMap.h @@ -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::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 { -- 2.39.5