From: Kefu Chai Date: Sun, 9 Jun 2019 10:10:02 +0000 (+0800) Subject: crimson/osd/pg_meta: use initializer list for passing set<> X-Git-Tag: v15.1.0~2513^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F28461%2Fhead;p=ceph.git crimson/osd/pg_meta: use initializer list for passing set<> we cannot assume that the data in string views are always nul terminated. this change partially reverts 82fedbd0089073cfe86640eaa7d73ed1e2545c31. Signed-off-by: Kefu Chai --- diff --git a/src/crimson/osd/pg_meta.cc b/src/crimson/osd/pg_meta.cc index 391b3182668f..4cf2051ec34a 100644 --- a/src/crimson/osd/pg_meta.cc +++ b/src/crimson/osd/pg_meta.cc @@ -32,11 +32,10 @@ namespace { seastar::future PGMeta::get_epoch() { auto ch = store->open_collection(coll_t{pgid}); - std::set keys{infover_key.data(), - epoch_key.data()}; return store->omap_get_values(ch, pgid.make_pgmeta_oid(), - keys).then( + {string{infover_key}, + string{epoch_key}}).then( [](auto&& values) { { // sanity check @@ -57,13 +56,12 @@ seastar::future PGMeta::get_epoch() seastar::future PGMeta::load() { auto ch = store->open_collection(coll_t{pgid}); - std::set keys{infover_key.data(), - info_key.data(), - biginfo_key.data(), - fastinfo_key.data()}; return store->omap_get_values(ch, pgid.make_pgmeta_oid(), - keys).then( + {string{infover_key}, + string{info_key}, + string{biginfo_key}, + string{fastinfo_key}}).then( [this](auto&& values) { { // sanity check