summaryrefslogtreecommitdiff
path: root/src/modules/mysql/db_mysql_execute.cpp
diff options
context:
space:
mode:
authorAdam <Adam@drink-coca-cola.info>2010-05-14 20:35:38 -0400
committerAdam <Adam@anope.org>2010-06-18 21:01:53 -0400
commitf049124905bd9f53439293e873003cb027a17b91 (patch)
tree352ed9251fd47055dd770aa2d5eabb20247e4b43 /src/modules/mysql/db_mysql_execute.cpp
parent81a45520a773732c9f46785f27aa1956150775d7 (diff)
Rewrote the hashing system to use std::tr1::unordered_map
Diffstat (limited to 'src/modules/mysql/db_mysql_execute.cpp')
-rw-r--r--src/modules/mysql/db_mysql_execute.cpp25
1 files changed, 6 insertions, 19 deletions
diff --git a/src/modules/mysql/db_mysql_execute.cpp b/src/modules/mysql/db_mysql_execute.cpp
index 3933d54d1..356f7c0f2 100644
--- a/src/modules/mysql/db_mysql_execute.cpp
+++ b/src/modules/mysql/db_mysql_execute.cpp
@@ -8,17 +8,12 @@ class FakeNickCore : public NickCore
public:
FakeNickCore() : NickCore("-SQLUser")
{
- if (this->next)
- this->next->prev = this->prev;
- if (this->prev)
- this->prev->next = this->next;
- else
- nclists[HASH(this->display)] = this->next;
+ NickCoreList.erase(this->display);
}
~FakeNickCore()
{
- insert_core(this);
+ NickCoreList[this->display] = this;
Users.clear();
}
@@ -39,23 +34,15 @@ class FakeUser : public User
this->vhost = NULL;
this->server = Me;
- if (this->prev)
- this->prev->next = this->next;
- else
- userlist[HASH(this->nick.c_str())] = this->next;
- if (this->next)
- this->next->prev = this->prev;
+ UserListByNick.erase("-SQLUser");
--usercnt;
}
~FakeUser()
{
- User **list = &userlist[HASH(this->nick.c_str())];
- this->next = *list;
- if (*list)
- (*list)->prev = this;
- *list = this;
+ UserListByNick["-SQLUser"] = this;
++usercnt;
+
nc = NULL;
}
@@ -145,7 +132,7 @@ class SQLTimer : public Timer
// XXX this whole strtok thing needs to die
char *cmdbuf = sstrdup(qres[i]["command"].c_str());
char *cmd = strtok(cmdbuf, " ");
- mod_run_cmd(bi->nick, u, bi->cmdTable, cmd);
+ mod_run_cmd(bi, u, cmd);
delete [] cmdbuf;
if (logout)