mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 19:19:02 -04:00
core_whowas Switch from map to a hash map and from irc::string to std::string
This commit is contained in:
parent
eef472fb62
commit
cf2fd595e0
@ -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
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user