Skip to content

Commit

Permalink
mds: refactor iterator lookup
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Donnelly <[email protected]>
  • Loading branch information
batrick committed Sep 9, 2021
1 parent 976741a commit 4034fc7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/mds/MDSMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -549,10 +549,10 @@ class MDSMap {
* 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 {
Expand Down

0 comments on commit 4034fc7

Please sign in to comment.