diff options
author | Sadie Powell <sadie@witchery.services> | 2023-10-10 21:14:50 +0100 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2023-10-11 15:51:52 +0100 |
commit | a3241065c55fd2a69e8793b89a5d0b1a957b3fd0 (patch) | |
tree | 82f80ce2f3bbbdc1c1ef05fe611093cf0b34eab6 /modules/commands/os_config.cpp | |
parent | dc371aad6d059dbf7f30f6878c680532bedd4146 (diff) |
Start migrating to range-based for loops.
Diffstat (limited to 'modules/commands/os_config.cpp')
-rw-r--r-- | modules/commands/os_config.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/modules/commands/os_config.cpp b/modules/commands/os_config.cpp index f94491a5c..3f211d695 100644 --- a/modules/commands/os_config.cpp +++ b/modules/commands/os_config.cpp @@ -62,11 +62,11 @@ class CommandOSConfig : public Command ListFormatter lflist(source.GetAccount()); lflist.AddColumn(_("Name")).AddColumn(_("Value")); - for (Configuration::Block::item_map::const_iterator it = items.begin(), it_end = items.end(); it != it_end; ++it) + for (const auto &[name, value] : items) { ListFormatter::ListEntry entry; - entry["Name"] = it->first; - entry["Value"] = it->second; + entry["Name"] = name; + entry["Value"] = value; lflist.AddEntry(entry); } @@ -75,8 +75,8 @@ class CommandOSConfig : public Command source.Reply(_("%s settings:"), block->GetName().c_str()); - for (unsigned j = 0; j < replies.size(); ++j) - source.Reply(replies[j]); + for (const auto &reply : replies) + source.Reply(reply); source.Reply(" "); } @@ -95,10 +95,10 @@ class CommandOSConfig : public Command ListFormatter::ListEntry entry; entry["Module Name"] = block->Get<Anope::string>("name"); - for (Configuration::Block::item_map::const_iterator it = items.begin(), it_end = items.end(); it != it_end; ++it) + for (const auto &[name, value] : items) { - entry["Name"] = it->first; - entry["Value"] = it->second; + entry["Name"] = name; + entry["Value"] = value; lflist.AddEntry(entry); } } @@ -108,8 +108,8 @@ class CommandOSConfig : public Command source.Reply(_("Module settings:")); - for (unsigned j = 0; j < replies.size(); ++j) - source.Reply(replies[j]); + for (const auto &reply : replies) + source.Reply(reply); source.Reply(_("End of configuration.")); } |