From: Patrick Donnelly Date: Thu, 10 Aug 2023 18:55:17 +0000 (-0400) Subject: mon: refactor loop variable names X-Git-Tag: v19.0.0~348^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4893f2b26fdd6af8ae119a1b3dc7da2ecd263675;p=ceph.git mon: refactor loop variable names To make it easier to read. Signed-off-by: Patrick Donnelly --- diff --git a/src/mon/ConfigMonitor.cc b/src/mon/ConfigMonitor.cc index e24ccbc1803..995f52992e7 100644 --- a/src/mon/ConfigMonitor.cc +++ b/src/mon/ConfigMonitor.cc @@ -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(); } }