summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/command_parse.cpp2
-rw-r--r--src/configparser.cpp2
-rw-r--r--src/mode.cpp4
-rw-r--r--src/modules/extra/m_ldap.cpp4
-rw-r--r--src/modules/extra/m_mssql.cpp2
-rw-r--r--src/modules/extra/m_mysql.cpp2
-rw-r--r--src/modules/extra/m_pgsql.cpp2
-rw-r--r--src/modules/extra/m_sqlite3.cpp2
-rw-r--r--src/modules/m_alias.cpp2
-rw-r--r--src/modules/m_callerid.cpp2
-rw-r--r--src/modules/m_censor.cpp2
-rw-r--r--src/modules/m_chanlog.cpp2
-rw-r--r--src/modules/m_filter.cpp2
-rw-r--r--src/modules/m_httpd_stats.cpp10
-rw-r--r--src/modules/m_messageflood.cpp8
-rw-r--r--src/modules/m_restrictchans.cpp2
-rw-r--r--src/modules/m_shun.cpp6
17 files changed, 25 insertions, 31 deletions
diff --git a/src/command_parse.cpp b/src/command_parse.cpp
index ed996e83c..793569d5b 100644
--- a/src/command_parse.cpp
+++ b/src/command_parse.cpp
@@ -60,7 +60,7 @@ bool CommandParser::LoopCall(User* user, Command* handler, const std::vector<std
*
* Only check for duplicates if there is one list (allow them in JOIN).
*/
- std::set<irc::string> dupes;
+ insp::flat_set<irc::string> dupes;
bool check_dupes = (extra < 0);
/* Create two sepstreams, if we have only one list, then initialize the second sepstream with
diff --git a/src/configparser.cpp b/src/configparser.cpp
index 6b0d8fa04..3be1ac9c5 100644
--- a/src/configparser.cpp
+++ b/src/configparser.cpp
@@ -155,7 +155,7 @@ struct Parser
}
else
{
- std::map<std::string, std::string>::iterator var = stack.vars.find(varname);
+ insp::flat_map<std::string, std::string>::iterator var = stack.vars.find(varname);
if (var == stack.vars.end())
throw CoreException("Undefined XML entity reference '&" + varname + ";'");
value.append(var->second);
diff --git a/src/mode.cpp b/src/mode.cpp
index b7aef1cdc..335bb85ce 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -790,7 +790,7 @@ std::string ModeParser::BuildPrefixes(bool lettersAndModes)
{
std::string mletters;
std::string mprefixes;
- std::map<int,std::pair<char,char> > prefixes;
+ insp::flat_map<int, std::pair<char, char> > prefixes;
const PrefixModeList& list = GetPrefixModes();
for (PrefixModeList::const_iterator i = list.begin(); i != list.end(); ++i)
@@ -800,7 +800,7 @@ std::string ModeParser::BuildPrefixes(bool lettersAndModes)
prefixes[pm->GetPrefixRank()] = std::make_pair(pm->GetPrefix(), pm->GetModeChar());
}
- for(std::map<int,std::pair<char,char> >::reverse_iterator n = prefixes.rbegin(); n != prefixes.rend(); n++)
+ for (insp::flat_map<int, std::pair<char, char> >::reverse_iterator n = prefixes.rbegin(); n != prefixes.rend(); ++n)
{
mletters = mletters + n->second.first;
mprefixes = mprefixes + n->second.second;
diff --git a/src/modules/extra/m_ldap.cpp b/src/modules/extra/m_ldap.cpp
index d696fadfb..10469f370 100644
--- a/src/modules/extra/m_ldap.cpp
+++ b/src/modules/extra/m_ldap.cpp
@@ -532,7 +532,7 @@ class LDAPService : public LDAPProvider, public SocketThread
class ModuleLDAP : public Module
{
- typedef std::map<std::string, LDAPService*> ServiceMap;
+ typedef insp::flat_map<std::string, LDAPService*> ServiceMap;
ServiceMap LDAPServices;
public:
@@ -610,7 +610,7 @@ class ModuleLDAP : public Module
~ModuleLDAP()
{
- for (std::map<std::string, LDAPService*>::iterator i = LDAPServices.begin(); i != LDAPServices.end(); ++i)
+ for (ServiceMap::iterator i = LDAPServices.begin(); i != LDAPServices.end(); ++i)
{
LDAPService* conn = i->second;
conn->join();
diff --git a/src/modules/extra/m_mssql.cpp b/src/modules/extra/m_mssql.cpp
index 725a647c0..0e8c8cf55 100644
--- a/src/modules/extra/m_mssql.cpp
+++ b/src/modules/extra/m_mssql.cpp
@@ -34,7 +34,7 @@ class SQLConn;
class MsSQLResult;
class ModuleMsSQL;
-typedef std::map<std::string, SQLConn*> ConnMap;
+typedef insp::flat_map<std::string, SQLConn*> ConnMap;
typedef std::deque<MsSQLResult*> ResultQueue;
unsigned long count(const char * const str, char a)
diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp
index 1002a98ba..1cb3635bb 100644
--- a/src/modules/extra/m_mysql.cpp
+++ b/src/modules/extra/m_mysql.cpp
@@ -89,7 +89,7 @@ struct RQueueItem
RQueueItem(SQLQuery* Q, MySQLresult* R) : q(Q), r(R) {}
};
-typedef std::map<std::string, SQLConnection*> ConnMap;
+typedef insp::flat_map<std::string, SQLConnection*> ConnMap;
typedef std::deque<QQueueItem> QueryQueue;
typedef std::deque<RQueueItem> ResultQueue;
diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp
index b89633ede..1e73c0143 100644
--- a/src/modules/extra/m_pgsql.cpp
+++ b/src/modules/extra/m_pgsql.cpp
@@ -41,7 +41,7 @@
class SQLConn;
class ModulePgSQL;
-typedef std::map<std::string, SQLConn*> ConnMap;
+typedef insp::flat_map<std::string, SQLConn*> ConnMap;
/* CREAD, Connecting and wants read event
* CWRITE, Connecting and wants write event
diff --git a/src/modules/extra/m_sqlite3.cpp b/src/modules/extra/m_sqlite3.cpp
index e5c8f600a..05203da39 100644
--- a/src/modules/extra/m_sqlite3.cpp
+++ b/src/modules/extra/m_sqlite3.cpp
@@ -40,7 +40,7 @@
/* $LinkerFlags: pkgconflibs("sqlite3","/libsqlite3.so","-lsqlite3") */
class SQLConn;
-typedef std::map<std::string, SQLConn*> ConnMap;
+typedef insp::flat_map<std::string, SQLConn*> ConnMap;
class SQLite3Result : public SQLResult
{
diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp
index 2d4bdded3..20d3f5c45 100644
--- a/src/modules/m_alias.cpp
+++ b/src/modules/m_alias.cpp
@@ -63,7 +63,7 @@ class ModuleAlias : public Module
* We can, however, use a fancy invention: the multimap. Maps a key to one or more values.
* -- w00t
*/
- typedef std::multimap<std::string, Alias, irc::insensitive_swo> AliasMap;
+ typedef insp::flat_multimap<std::string, Alias, irc::insensitive_swo> AliasMap;
AliasMap Aliases;
diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp
index add1d929e..efbf1a81b 100644
--- a/src/modules/m_callerid.cpp
+++ b/src/modules/m_callerid.cpp
@@ -37,7 +37,7 @@ enum
class callerid_data
{
public:
- typedef std::set<User*> UserSet;
+ typedef insp::flat_set<User*> UserSet;
typedef std::vector<callerid_data*> CallerIdDataSet;
time_t lastnotify;
diff --git a/src/modules/m_censor.cpp b/src/modules/m_censor.cpp
index 209d61d4a..da22b5153 100644
--- a/src/modules/m_censor.cpp
+++ b/src/modules/m_censor.cpp
@@ -22,7 +22,7 @@
#include "inspircd.h"
-typedef std::map<irc::string,irc::string> censor_t;
+typedef insp::flat_map<irc::string, irc::string> censor_t;
/** Handles usermode +G
*/
diff --git a/src/modules/m_chanlog.cpp b/src/modules/m_chanlog.cpp
index 736285be8..0624b4a86 100644
--- a/src/modules/m_chanlog.cpp
+++ b/src/modules/m_chanlog.cpp
@@ -25,7 +25,7 @@ class ModuleChanLog : public Module
/*
* Multimap so people can redirect a snomask to multiple channels.
*/
- typedef std::multimap<char, std::string> ChanLogTargets;
+ typedef insp::flat_multimap<char, std::string> ChanLogTargets;
ChanLogTargets logstreams;
public:
diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp
index 9acce033a..34d0bebb3 100644
--- a/src/modules/m_filter.cpp
+++ b/src/modules/m_filter.cpp
@@ -156,7 +156,7 @@ class CommandFilter : public Command
class ModuleFilter : public Module
{
- typedef std::set<std::string, irc::insensitive_swo> ExemptTargetSet;
+ typedef insp::flat_set<std::string, irc::insensitive_swo> ExemptTargetSet;
bool initing;
RegexFactory* factory;
diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp
index 84cca7e01..30eacd7a7 100644
--- a/src/modules/m_httpd_stats.cpp
+++ b/src/modules/m_httpd_stats.cpp
@@ -27,7 +27,7 @@
class ModuleHttpStats : public Module
{
- static std::map<char, char const*> const &entities;
+ static const insp::flat_map<char, char const*>& entities;
HTTPdAPI API;
public:
@@ -43,7 +43,7 @@ class ModuleHttpStats : public Module
for (std::string::const_iterator x = str.begin(); x != str.end(); ++x)
{
- std::map<char, char const*>::const_iterator it = entities.find(*x);
+ insp::flat_map<char, char const*>::const_iterator it = entities.find(*x);
if (it != entities.end())
{
@@ -241,9 +241,9 @@ class ModuleHttpStats : public Module
}
};
-static std::map<char, char const*> const &init_entities()
+static const insp::flat_map<char, char const*>& init_entities()
{
- static std::map<char, char const*> entities;
+ static insp::flat_map<char, char const*> entities;
entities['<'] = "lt";
entities['>'] = "gt";
entities['&'] = "amp";
@@ -251,6 +251,6 @@ static std::map<char, char const*> const &init_entities()
return entities;
}
-std::map<char, char const*> const &ModuleHttpStats::entities = init_entities ();
+const insp::flat_map<char, char const*>& ModuleHttpStats::entities = init_entities();
MODULE_INIT(ModuleHttpStats)
diff --git a/src/modules/m_messageflood.cpp b/src/modules/m_messageflood.cpp
index 3cebd2a5f..1faf3bfb9 100644
--- a/src/modules/m_messageflood.cpp
+++ b/src/modules/m_messageflood.cpp
@@ -34,7 +34,7 @@ class floodsettings
unsigned int secs;
unsigned int lines;
time_t reset;
- std::map<User*, unsigned int> counters;
+ insp::flat_map<User*, unsigned int> counters;
floodsettings(bool a, int b, int c) : ban(a), secs(b), lines(c)
{
@@ -54,11 +54,7 @@ class floodsettings
void clear(User* who)
{
- std::map<User*, unsigned int>::iterator iter = counters.find(who);
- if (iter != counters.end())
- {
- counters.erase(iter);
- }
+ counters.erase(who);
}
};
diff --git a/src/modules/m_restrictchans.cpp b/src/modules/m_restrictchans.cpp
index b619ee448..9e660e8ed 100644
--- a/src/modules/m_restrictchans.cpp
+++ b/src/modules/m_restrictchans.cpp
@@ -24,7 +24,7 @@
class ModuleRestrictChans : public Module
{
- std::set<std::string, irc::insensitive_swo> allowchans;
+ insp::flat_set<std::string, irc::insensitive_swo> allowchans;
public:
void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
diff --git a/src/modules/m_shun.cpp b/src/modules/m_shun.cpp
index 075b80eb7..7ea16b5b0 100644
--- a/src/modules/m_shun.cpp
+++ b/src/modules/m_shun.cpp
@@ -168,7 +168,7 @@ class ModuleShun : public Module
{
CommandShun cmd;
ShunFactory f;
- std::set<std::string> ShunEnabledCommands;
+ insp::flat_set<std::string> ShunEnabledCommands;
bool NotifyOfShun;
bool affectopers;
@@ -243,9 +243,7 @@ class ModuleShun : public Module
return MOD_RES_PASSTHRU;
}
- std::set<std::string>::iterator i = ShunEnabledCommands.find(command);
-
- if (i == ShunEnabledCommands.end())
+ if (!ShunEnabledCommands.count(command))
{
if (NotifyOfShun)
user->WriteNotice("*** Command " + command + " not processed, as you have been blocked from issuing commands (SHUN)");