]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore: use structured binding
authorKefu Chai <kchai@redhat.com>
Sat, 5 Jun 2021 09:22:35 +0000 (17:22 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 5 Jun 2021 10:02:45 +0000 (18:02 +0800)
for better readability

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

index 1cd440d2b6b1c146d23d5548b88bd9028b4f6d5a..bb8754e58eb39ccd66e079a223fab52600b0907b 100644 (file)
@@ -48,13 +48,9 @@ CollectionNode::list()
 {
   read_to_local();
   logger().debug("CollectionNode:{}, {}", __func__, *this);
-  std::vector<std::pair<coll_t, coll_info_t>> list_result;
-  for (auto &&it : decoded) {
-    list_result.emplace_back(
-      std::make_pair(
-        static_cast<coll_t>(it.first),
-        coll_info_t{ it.second }
-      ));
+  CollectionManager::list_ret_bare list_result;
+  for (auto &[coll, bits] : decoded) {
+    list_result.emplace_back(coll, bits);
   }
   return list_ret(
     list_ertr::ready_future_marker{},