From ab48b941f222dcedb7e169c054a102005e1af03c Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 4 Apr 2026 18:15:30 +0100 Subject: Add insp::find_value, insp::to_ptr and switch code to use them. --- src/commands.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/commands.cpp') 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 -- cgit v1.3.1-10-gc9f91