]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Changed from std::map to hash_map
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Wed, 28 Dec 2005 21:21:54 +0000 (21:21 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Wed, 28 Dec 2005 21:21:54 +0000 (21:21 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2686 e03df62e-2008-0410-955e-edbf42e46eb7

include/ctables.h
src/command_parse.cpp

index e5cdddefb2ecd634727bc4eb8b7b41cff1f9b199..14b12610fa56174bc33a829633e99080e3e92ddb 100644 (file)
 #define __CTABLES_H__
 
 #include "inspircd_config.h"
-#include <map>
+
+#ifdef GCC3
+#include <ext/hash_map>
+#else
+#include <hash_map>
+#endif
+
+#ifdef GCC3
+#define nspace __gnu_cxx
+#else
+#define nspace std
+#endif
 
 class userrec;
 
@@ -59,7 +70,7 @@ class command_t
        virtual ~command_t() {}
 };
 
-typedef std::map<std::string,command_t*> command_table;
+typedef nspace::hash_map<std::string,command_t*> command_table;
 
 #endif
 
index 5e89c2841df0997431928f8699262475e17b7cd7..02db6258f62bcd9faddedf63a2fd9697f6d25c64 100644 (file)
@@ -60,6 +60,13 @@ using namespace std;
 #include "command_parse.h"
 #include "ctables.h"
 
+#ifdef GCC3
+#define nspace __gnu_cxx
+#else
+#define nspace std
+#endif
+
+
 extern InspIRCd* ServerInstance;
 
 extern std::vector<Module*> modules;
@@ -248,7 +255,7 @@ int CommandParser::LoopCall(command_t* fn, char **parameters, int pcnt, userrec
 
 bool CommandParser::IsValidCommand(std::string &commandname, int pcnt, userrec * user)
 {
-       std::map<std::string,command_t*>::iterator n = cmdlist.find(commandname);
+       nspace::hash_map<std::string,command_t*>::iterator n = cmdlist.find(commandname);
        if (n != cmdlist.end())
        {
                         if ((pcnt>=n->second->min_params) && (n->second->source != "<core>"))
@@ -277,7 +284,7 @@ bool CommandParser::IsValidCommand(std::string &commandname, int pcnt, userrec *
 
 void CommandParser::CallHandler(std::string &commandname,char **parameters, int pcnt, userrec *user)
 {
-       std::map<std::string,command_t*>::iterator n = cmdlist.find(commandname);
+       nspace::hash_map<std::string,command_t*>::iterator n = cmdlist.find(commandname);
         if (n != cmdlist.end())
         {
                         if (pcnt >= n->second->min_params)
@@ -527,7 +534,7 @@ void CommandParser::ProcessCommand(userrec *user, char* cmd)
                return;
        }
        
-       std::map<std::string,command_t*>::iterator cm = cmdlist.find(xcommand);
+       nspace::hash_map<std::string,command_t*>::iterator cm = cmdlist.find(xcommand);
        
         if (cm != cmdlist.end())
         {
@@ -624,7 +631,7 @@ bool CommandParser::RemoveCommands(const char* source)
         while (go_again)
         {
                 go_again = false;
-                for (std::map<std::string,command_t*>::iterator i = cmdlist.begin(); i != cmdlist.end(); i++)
+                for (nspace::hash_map<std::string,command_t*>::iterator i = cmdlist.begin(); i != cmdlist.end(); i++)
                 {
                        command_t* x = i->second;
                         if (x->source == std::string(source))