]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os: Use operator[] in CyanStore when inserting values to object omap 42915/head
authorAmnon Hanuhov <amnonswe@gmail.com>
Wed, 25 Aug 2021 06:22:30 +0000 (09:22 +0300)
committerAmnon Hanuhov <amnonswe@gmail.com>
Wed, 25 Aug 2021 06:22:30 +0000 (09:22 +0300)
std::map::insert() doesn't update the value associated with an existing
key, therefore we should use operator[] instead

Signed-off-by: Amnon Hanuhov <ahanukov@redhat.com>
src/crimson/os/cyanstore/cyan_store.cc

index 964025234c107af94bb0188dec3c274bca52fd76..149f87328a156979614d77a0c96e2b630848b833 100644 (file)
@@ -576,7 +576,7 @@ int CyanStore::_omap_set_values(
 
   ObjectRef o = c->get_or_create_object(oid);
   for (auto &&i: aset) {
-    o->omap.insert(std::move(i));
+    o->omap[std::move(i.first)] = std::move(i.second);
   }
   return 0;
 }