aboutsummaryrefslogtreecommitdiffstats
path: root/src/commands.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2026-04-04 18:15:30 +0100
committerGravatar Sadie Powell2026-04-04 18:15:30 +0100
commitab48b941f222dcedb7e169c054a102005e1af03c (patch)
treea481c70d1ae3073b1bc192e32e12010df20a2cc2 /src/commands.cpp
parentPass a server reference to OnRouteMessage. (diff)
Add insp::find_value, insp::to_ptr and switch code to use them.
Diffstat (limited to 'src/commands.cpp')
-rw-r--r--src/commands.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/commands.cpp b/src/commands.cpp
index b7f5faea6..365d6006a 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -27,6 +27,7 @@
#include "inspircd.h"
#include "numerichelper.h"
#include "stringutils.h"
+#include "utility/container.h"
bool CommandParser::LoopCall(User* user, Command* handler, const CommandBase::Params& parameters, size_t splithere, size_t extra, bool usemax)
{
@@ -103,11 +104,7 @@ bool CommandParser::LoopCall(User* user, Command* handler, const CommandBase::Pa
Command* CommandParser::GetHandler(const std::string& commandname)
{
- CommandMap::iterator n = cmdlist.find(commandname);
- if (n != cmdlist.end())
- return n->second;
-
- return nullptr;
+ return insp::find_value(cmdlist, commandname);
}
// calls a handler function for a command