]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Remove global Commandtable typedef
authorAttila Molnar <attilamolnar@hush.com>
Fri, 13 Jun 2014 13:42:38 +0000 (15:42 +0200)
committerAttila Molnar <attilamolnar@hush.com>
Fri, 13 Jun 2014 13:42:38 +0000 (15:42 +0200)
include/command_parse.h
include/typedefs.h
src/command_parse.cpp

index 2abbdb6076cf0f0f5b07b15d2168b6d4a4a4ddf7..0f39d35860f3ec7415372fadb7eb5bfd2e625882 100644 (file)
@@ -30,7 +30,7 @@
 class CoreExport CommandParser
 {
  public:
-       typedef Commandtable CommandMap;
+       typedef TR1NS::unordered_map<std::string, Command*> CommandMap;
 
  private:
        /** Process a command from a user.
@@ -41,7 +41,7 @@ class CoreExport CommandParser
 
        /** Command list, a hash_map of command names to Command*
         */
-       Commandtable cmdlist;
+       CommandMap cmdlist;
 
  public:
        /** Default constructor.
index 336084c556657aaf4715fe9400325cf91953f432..c883a085966c92427ca92a425d643e4d711c0c25 100644 (file)
@@ -100,10 +100,6 @@ typedef std::map<std::string, reference<OperInfo> > OperIndex;
 /** Files read by the configuration */
 typedef std::map<std::string, file_cache> ConfigFileCache;
 
-/** A hash of commands used by the core
- */
-typedef TR1NS::unordered_map<std::string, Command*> Commandtable;
-
 /** Membership list of a channel */
 typedef std::map<User*, Membership*> UserMembList;
 /** Iterator of UserMembList */
index 0669c89ada50e9f1cbd7da3afa59a13b9c893697..82bfe09621897a561ffb74351bc21f0663afbc21 100644 (file)
@@ -109,7 +109,7 @@ bool CommandParser::LoopCall(User* user, Command* handler, const std::vector<std
 
 Command* CommandParser::GetHandler(const std::string &commandname)
 {
-       Commandtable::iterator n = cmdlist.find(commandname);
+       CommandMap::iterator n = cmdlist.find(commandname);
        if (n != cmdlist.end())
                return n->second;
 
@@ -120,7 +120,7 @@ Command* CommandParser::GetHandler(const std::string &commandname)
 
 CmdResult CommandParser::CallHandler(const std::string& commandname, const std::vector<std::string>& parameters, User* user, Command** cmd)
 {
-       Commandtable::iterator n = cmdlist.find(commandname);
+       CommandMap::iterator n = cmdlist.find(commandname);
 
        if (n != cmdlist.end())
        {
@@ -322,7 +322,7 @@ void CommandParser::ProcessCommand(LocalUser *user, std::string &cmd)
 
 void CommandParser::RemoveCommand(Command* x)
 {
-       Commandtable::iterator n = cmdlist.find(x->name);
+       CommandMap::iterator n = cmdlist.find(x->name);
        if (n != cmdlist.end() && n->second == x)
                cmdlist.erase(n);
 }