} 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();
}
}