]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/os: s/try_emplace()/insert()/
authorKefu Chai <kchai@redhat.com>
Sat, 24 Aug 2019 02:57:32 +0000 (10:57 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 27 Aug 2019 16:03:53 +0000 (00:03 +0800)
avoid specifying the type of `map<>::value_type`.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/os/cyan_store.cc

index 1afd1a90b5a1805d72c1626ad315f8e10086ed08..337e819471d6c5dc20eb9da9b35791a474779eb1 100644 (file)
@@ -588,7 +588,7 @@ int CyanStore::_setattrs(const coll_t& cid, const ghobject_t& oid,
 
 int CyanStore::_create_collection(const coll_t& cid, int bits)
 {
-  auto result = coll_map.insert(std::make_pair(cid, CollectionRef()));
+  auto result = coll_map.try_emplace(cid);
   if (!result.second)
     return -EEXIST;
   auto p = new_coll_map.find(cid);