summaryrefslogtreecommitdiff
path: root/modules/commands/os_akill.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/commands/os_akill.cpp')
-rw-r--r--modules/commands/os_akill.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/modules/commands/os_akill.cpp b/modules/commands/os_akill.cpp
index 899c2410e..31f96b507 100644
--- a/modules/commands/os_akill.cpp
+++ b/modules/commands/os_akill.cpp
@@ -16,14 +16,14 @@ static ServiceReference<XLineManager> akills("XLineManager", "xlinemanager/sglin
class AkillDelCallback : public NumberList
{
CommandSource &source;
- unsigned deleted;
+ unsigned deleted = 0;
Command *cmd;
public:
- AkillDelCallback(CommandSource &_source, const Anope::string &numlist, Command *c) : NumberList(numlist, true), source(_source), deleted(0), cmd(c)
+ AkillDelCallback(CommandSource &_source, const Anope::string &numlist, Command *c) : NumberList(numlist, true), source(_source), cmd(c)
{
}
- ~AkillDelCallback()
+ ~AkillDelCallback() override
{
if (!deleted)
source.Reply(_("No matching entries on the AKILL list."));
@@ -33,7 +33,7 @@ class AkillDelCallback : public NumberList
source.Reply(_("Deleted %d entries from the AKILL list."), deleted);
}
- void HandleNumber(unsigned number) anope_override
+ void HandleNumber(unsigned number) override
{
if (!number)
return;
@@ -172,8 +172,8 @@ class CommandOSAKill : public Command
x->id = XLineManager::GenerateUID();
unsigned int affected = 0;
- for (user_map::const_iterator it = UserListByNick.begin(); it != UserListByNick.end(); ++it)
- if (akills->Check(it->second, x))
+ for (const auto &[_, user] : UserListByNick)
+ if (akills->Check(user, x))
++affected;
float percent = static_cast<float>(affected) / static_cast<float>(UserListByNick.size()) * 100.0;
@@ -271,7 +271,7 @@ class CommandOSAKill : public Command
{
}
- void HandleNumber(unsigned number) anope_override
+ void HandleNumber(unsigned number) override
{
if (!number)
return;
@@ -325,8 +325,8 @@ class CommandOSAKill : public Command
std::vector<Anope::string> replies;
list.Process(replies);
- for (unsigned i = 0; i < replies.size(); ++i)
- source.Reply(replies[i]);
+ for (const auto &reply : replies)
+ source.Reply(reply);
source.Reply(_("End of AKILL list."));
}
@@ -390,7 +390,7 @@ class CommandOSAKill : public Command
this->SetSyntax("CLEAR");
}
- void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
+ void Execute(CommandSource &source, const std::vector<Anope::string> &params) override
{
const Anope::string &cmd = params[0];
@@ -413,7 +413,7 @@ class CommandOSAKill : public Command
return;
}
- bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override
+ bool OnHelp(CommandSource &source, const Anope::string &subcommand) override
{
this->SendSyntax(source);
source.Reply(" ");