From 542855ded62ef6f54c48f27240de19a08718aff6 Mon Sep 17 00:00:00 2001 From: Michal Jarzabek Date: Fri, 7 Oct 2016 23:15:27 +0100 Subject: [PATCH] mds/CInode.h: remove unneeded use of count Signed-off-by: Michal Jarzabek --- src/mds/CInode.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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; } -- 2.47.3