summaryrefslogtreecommitdiff
path: root/modules/commands/cs_log.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-06-25 11:02:19 -0400
committerAdam <Adam@anope.org>2014-06-25 11:02:19 -0400
commitee3289029d61da12013e0f5a3e4faf2d07543a0e (patch)
treedf7391c321a913fc56db2d075292c0a6ddb0536d /modules/commands/cs_log.cpp
parentfd9bb0ea7e3c8a39f1632c2ebbdc25d0fac192a0 (diff)
Remove the rest of the 1.8 logic "let's write all of the command handler with no return statement!"
Fix if (something) else if (!something) tests Remove returns at the bottom of void functions
Diffstat (limited to 'modules/commands/cs_log.cpp')
-rw-r--r--modules/commands/cs_log.cpp44
1 files changed, 23 insertions, 21 deletions
diff --git a/modules/commands/cs_log.cpp b/modules/commands/cs_log.cpp
index 9fd1a2fdf..5c80448c2 100644
--- a/modules/commands/cs_log.cpp
+++ b/modules/commands/cs_log.cpp
@@ -129,33 +129,35 @@ public:
{
LogSettings *ls = ci->Require<LogSettings>("logsettings");
if (!ls || (*ls)->empty())
- source.Reply(_("There currently are no logging configurations for \002{0}\002."), ci->name);
- else
{
- ListFormatter list(source.GetAccount());
- list.AddColumn(_("Number")).AddColumn(_("Service")).AddColumn(_("Command")).AddColumn(_("Method")).AddColumn("");
+ source.Reply(_("There currently are no logging configurations for \002{0}\002."), ci->name);
+ return;
+ }
- for (unsigned i = 0; i < (*ls)->size(); ++i)
- {
- const LogSetting *log = (*ls)->at(i);
-
- ListFormatter::ListEntry entry;
- entry["Number"] = stringify(i + 1);
- entry["Service"] = log->command_service;
- entry["Command"] = !log->command_name.empty() ? log->command_name : log->service_name;
- entry["Method"] = log->method;
- entry[""] = log->extra;
- list.AddEntry(entry);
- }
- source.Reply(_("Log list for \002{0}\002:"), ci->name);
+ ListFormatter list(source.GetAccount());
+ list.AddColumn(_("Number")).AddColumn(_("Service")).AddColumn(_("Command")).AddColumn(_("Method")).AddColumn("");
- std::vector<Anope::string> replies;
- list.Process(replies);
+ for (unsigned i = 0; i < (*ls)->size(); ++i)
+ {
+ const LogSetting *log = (*ls)->at(i);
- for (unsigned i = 0; i < replies.size(); ++i)
- source.Reply(replies[i]);
+ ListFormatter::ListEntry entry;
+ entry["Number"] = stringify(i + 1);
+ entry["Service"] = log->command_service;
+ entry["Command"] = !log->command_name.empty() ? log->command_name : log->service_name;
+ entry["Method"] = log->method;
+ entry[""] = log->extra;
+ list.AddEntry(entry);
}
+
+ source.Reply(_("Log list for \002{0}\002:"), ci->name);
+
+ std::vector<Anope::string> replies;
+ list.Process(replies);
+
+ for (unsigned i = 0; i < replies.size(); ++i)
+ source.Reply(replies[i]);
}
else if (params.size() > 2)
{