]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: refactor loop variable names 52938/head
authorPatrick Donnelly <pdonnell@redhat.com>
Thu, 10 Aug 2023 18:55:17 +0000 (14:55 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Thu, 10 Aug 2023 20:11:05 +0000 (16:11 -0400)
To make it easier to read.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/mon/ConfigMonitor.cc

index e24ccbc1803d1abfce0886bd025f48608e469b43..995f52992e79d591d511b2fabaa0077d015b455e 100644 (file)
@@ -264,20 +264,20 @@ bool ConfigMonitor::preprocess_command(MonOpRequestRef op)
     } else {
       f->open_array_section("config");
     }
-    for (auto s : sections) {
-      for (auto& i : s.second->options) {
+    for (auto& [sec_name, section] : sections) {
+      for (auto& [opt_name, masked_opt] : section->options) {
        if (!f) {
-         tbl << s.first;
-         tbl << i.second.mask.to_str();
-         tbl << Option::level_to_str(i.second.opt->level);
-          tbl << i.first;
-         tbl << i.second.raw_value;
-         tbl << (i.second.opt->can_update_at_runtime() ? "" : "*");
+         tbl << sec_name;
+         tbl << masked_opt.mask.to_str();
+         tbl << Option::level_to_str(masked_opt.opt->level);
+          tbl << opt_name;
+         tbl << masked_opt.raw_value;
+         tbl << (masked_opt.opt->can_update_at_runtime() ? "" : "*");
          tbl << TextTable::endrow;
        } else {
          f->open_object_section("option");
-         f->dump_string("section", s.first);
-         i.second.dump(f.get());
+         f->dump_string("section", sec_name);
+         masked_opt.dump(f.get());
          f->close_section();
        }
       }