also avoid using `map[key] = val` for setting an item in map, as, if
the key does not exist in map, `map[key]` would have to create a value
using its default ctor, and then call the `operator=(bufferlist&&)` to
set it.
Signed-off-by: Kefu Chai <kchai@redhat.com>
return -ENOENT;
ObjectRef o = c->get_or_create_object(oid);
- for (auto &&i: aset) {
- o->omap[std::move(i.first)] = std::move(i.second);
+ for (auto&& [key, val]: aset) {
+ o->omap.insert_or_assign(std::move(key), std::move(val));
}
return 0;
}