summaryrefslogtreecommitdiff
path: root/modules/commands/ns_alist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/commands/ns_alist.cpp')
-rw-r--r--modules/commands/ns_alist.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/modules/commands/ns_alist.cpp b/modules/commands/ns_alist.cpp
index dc4a0a19e..e0f160aa2 100644
--- a/modules/commands/ns_alist.cpp
+++ b/modules/commands/ns_alist.cpp
@@ -25,7 +25,7 @@ class CommandNSAList : public Command
this->SetSyntax(_("[\037nickname\037]"));
}
- void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
+ void Execute(CommandSource &source, const std::vector<Anope::string> &params) override
{
Anope::string nick = source.GetNick();
NickCore *nc = source.nc;
@@ -51,9 +51,8 @@ class CommandNSAList : public Command
nc->GetChannelReferences(queue);
std::sort(queue.begin(), queue.end(), ChannelSort);
- for (unsigned i = 0; i < queue.size(); ++i)
+ for (auto *ci : queue)
{
- ChannelInfo *ci = queue[i];
ListFormatter::ListEntry entry;
if (ci->GetFounder() == nc)
@@ -86,10 +85,8 @@ class CommandNSAList : public Command
entry["Number"] = stringify(chan_count);
entry["Channel"] = (ci->HasExt("CS_NO_EXPIRE") ? "!" : "") + ci->name;
- for (unsigned j = 0; j < access.paths.size(); ++j)
+ for (auto &p : access.paths)
{
- ChanAccess::Path &p = access.paths[j];
-
// not interested in indirect access
if (p.size() != 1)
continue;
@@ -113,14 +110,14 @@ class CommandNSAList : public Command
{
source.Reply(_("Channels that \002%s\002 has access on:"), nc->display.c_str());
- for (unsigned i = 0; i < replies.size(); ++i)
- source.Reply(replies[i]);
+ for (const auto &reply : replies)
+ source.Reply(reply);
source.Reply(_("End of list - %d channels shown."), chan_count);
}
}
- bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override
+ bool OnHelp(CommandSource &source, const Anope::string &subcommand) override
{
this->SendSyntax(source);
source.Reply(" ");