summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-07-09 15:16:22 +0200
committerAttila Molnar <attilamolnar@hush.com>2014-07-09 15:16:22 +0200
commitcf2fd595e08ff181f062bb238aea646ed719d946 (patch)
treeff12755a44f76c6c8b823d1d8efbf0fb5918dc5f
parenteef472fb62c299d4900baf0339e0eaf08648dcf1 (diff)
core_whowas Switch from map to a hash map and from irc::string to std::string
-rw-r--r--include/commands/cmd_whowas.h6
-rw-r--r--src/coremods/core_whowas.cpp6
2 files changed, 6 insertions, 6 deletions
diff --git a/include/commands/cmd_whowas.h b/include/commands/cmd_whowas.h
index 021e9e3b7..8e1a8059d 100644
--- a/include/commands/cmd_whowas.h
+++ b/include/commands/cmd_whowas.h
@@ -46,11 +46,11 @@ namespace WhoWas
/** Nickname whose information is stored in this class
*/
- const irc::string nick;
+ const std::string nick;
/** Constructor to initialize fields
*/
- Nick(const irc::string& nickname);
+ Nick(const std::string& nickname);
/** Destructor, deallocates all elements in the entries container
*/
@@ -64,7 +64,7 @@ namespace WhoWas
/** Sets of users in the whowas system
*/
-typedef std::map<irc::string, WhoWas::Nick*> whowas_users;
+typedef TR1NS::unordered_map<std::string, WhoWas::Nick*, irc::insensitive, irc::StrHashComp> whowas_users;
/** Handle /WHOWAS. These command handlers can be reloaded by the core,
* and handle basic RFC1459 commands. Commands within modules work
diff --git a/src/coremods/core_whowas.cpp b/src/coremods/core_whowas.cpp
index a27eb4341..6c16ca1a3 100644
--- a/src/coremods/core_whowas.cpp
+++ b/src/coremods/core_whowas.cpp
@@ -40,7 +40,7 @@ CmdResult CommandWhowas::Handle (const std::vector<std::string>& parameters, Use
return CMD_FAILURE;
}
- whowas_users::iterator i = whowas.find(assign(parameters[0]));
+ whowas_users::iterator i = whowas.find(parameters[0]);
if (i == whowas.end())
{
@@ -99,7 +99,7 @@ void CommandWhowas::AddToWhoWas(User* user)
// Insert nick if it doesn't exist
// 'first' will point to the newly inserted element or to the existing element with an equivalent key
- std::pair<whowas_users::iterator, bool> ret = whowas.insert(std::make_pair(irc::string(user->nick.c_str()), static_cast<WhoWas::Nick*>(NULL)));
+ std::pair<whowas_users::iterator, bool> ret = whowas.insert(std::make_pair(user->nick, static_cast<WhoWas::Nick*>(NULL)));
if (ret.second) // If inserted
{
@@ -202,7 +202,7 @@ WhoWasGroup::WhoWasGroup(User* user) : host(user->host), dhost(user->dhost), ide
{
}
-WhoWas::Nick::Nick(const irc::string& nickname)
+WhoWas::Nick::Nick(const std::string& nickname)
: addtime(ServerInstance->Time())
, nick(nickname)
{