]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.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)
committerNathan Cutler <ncutler@suse.com>
Wed, 16 Oct 2019 10:43:36 +0000 (12:43 +0200)
This prevents accidental type mismatches.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit ae8ac528da1797b740a6fd4a223855cec6106b21)

src/mds/SessionMap.h

index e194468ce496ec6b1569348b61104088f7197b2a..fd03dd5cbda0fec6c65cafcaa8b2019e3b5d7cab 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;
   }