]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
kv/RocksDBStore: use structured binding for better readablity
authorKefu Chai <kchai@redhat.com>
Sat, 27 Jun 2020 11:30:35 +0000 (19:30 +0800)
committerKefu Chai <kchai@redhat.com>
Sat, 27 Jun 2020 14:48:48 +0000 (22:48 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/kv/RocksDBStore.cc

index 030ca7fed8ab995e8eaa4719650393419d2aa79a..70066027733aa2f2761f74012ea045a4673106f7 100644 (file)
@@ -2911,12 +2911,12 @@ int RocksDBStore::reshard_cleanup(const std::vector<std::string>& current_column
                                  const std::vector<rocksdb::ColumnFamilyHandle*>& current_handles)
 {
   std::vector<std::string> new_sharding_columns;
-  for (const auto& col: cf_handles) {
-    if (col.second.handles.size() == 1) {
-      new_sharding_columns.push_back(col.first);
+  for (const auto& [name, handle] : cf_handles) {
+    if (handle.handles.size() == 1) {
+      new_sharding_columns.push_back(name);
     } else {
-      for (size_t i = 0; i < col.second.handles.size(); i++) {
-       new_sharding_columns.push_back(col.first + "-" + to_string(i));
+      for (size_t i = 0; i < handle.handles.size(); i++) {
+       new_sharding_columns.push_back(name + "-" + to_string(i));
       }
     }
   }