]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/osd_type: map.find() -> map.count() for existense checking
authorxie xingguo <xie.xingguo@zte.com.cn>
Sat, 24 Jun 2017 04:13:15 +0000 (12:13 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Mon, 26 Jun 2017 12:23:28 +0000 (20:23 +0800)
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/osd/osd_types.cc

index 056cd12de4e50ba02e2dce00c50d68492c849c1d..07ddc912b32856878895773df9c38391ad058faf 100644 (file)
@@ -987,7 +987,7 @@ static opt_mapping_t opt_mapping = boost::assign::map_list_of
             pool_opts_t::CSUM_MIN_BLOCK, pool_opts_t::INT));
 
 bool pool_opts_t::is_opt_name(const std::string& name) {
-    return opt_mapping.find(name) != opt_mapping.end();
+    return opt_mapping.count(name);
 }
 
 pool_opts_t::opt_desc_t pool_opts_t::get_opt_desc(const std::string& name) {
@@ -997,7 +997,7 @@ pool_opts_t::opt_desc_t pool_opts_t::get_opt_desc(const std::string& name) {
 }
 
 bool pool_opts_t::is_set(pool_opts_t::key_t key) const {
-    return opts.find(key) != opts.end();
+    return opts.count(key);
 }
 
 const pool_opts_t::value_t& pool_opts_t::get(pool_opts_t::key_t key) const {