]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mds: use auto to deduce iterator type
authorPatrick Donnelly <pdonnell@redhat.com>
Fri, 2 Aug 2019 20:32:55 +0000 (13:32 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Fri, 13 Sep 2019 00:42:03 +0000 (17:42 -0700)
This prevents accidental type mismatches.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/mds/SessionMap.h

index 0c3bcc5c6d53ef265759e398a2693d8ed660b116..2e30433436bc7d57085067f12df10cc8039a2c04 100644 (file)
@@ -606,8 +606,8 @@ public:
   }
 
   bool is_any_state(int state) const {
-    map<int,xlist<Session*>* >::const_iterator p = by_state.find(state);
-    if (p == by_state.end() || p->second->empty())
+    auto it = by_state.find(state);
+    if (it == by_state.end() || it->second->empty())
       return false;
     return true;
   }