From: Michal Jarzabek Date: Fri, 7 Oct 2016 22:15:27 +0000 (+0100) Subject: mds/CInode.h: remove unneeded use of count X-Git-Tag: v11.1.0~683^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F11371%2Fhead;p=ceph.git mds/CInode.h: remove unneeded use of count Signed-off-by: Michal Jarzabek --- diff --git a/src/mds/CInode.h b/src/mds/CInode.h index eb70325c9d92..ba232f85ab58 100644 --- a/src/mds/CInode.h +++ b/src/mds/CInode.h @@ -971,14 +971,15 @@ public: const std::map& get_client_caps() const { return client_caps; } Capability *get_client_cap(client_t client) { - if (client_caps.count(client)) - return client_caps[client]; + auto client_caps_entry = client_caps.find(client); + if (client_caps_entry != client_caps.end()) + return client_caps_entry->second; return 0; } int get_client_cap_pending(client_t client) const { - if (client_caps.count(client)) { - std::map::const_iterator found = client_caps.find(client); - return found->second->pending(); + auto client_caps_entry = client_caps.find(client); + if (client_caps_entry != client_caps.end()) { + return client_caps_entry->second->pending(); } else { return 0; }