summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2022-09-12 20:33:21 +0100
committerSadie Powell <sadie@witchery.services>2022-12-09 16:50:29 +0000
commit5fa3d8f9297f50e25a7bad6a9bde91b9024330de (patch)
tree26cd885ac78b345361471fa55a7d0801449ede3e /modules
parent1a2da821064f8d869b999fb8e32ffeddfc82967b (diff)
Use emplace() instead of insert(std::make_pair()).
Diffstat (limited to 'modules')
-rw-r--r--modules/commands/cs_flags.cpp2
-rw-r--r--modules/commands/cs_set.cpp4
-rw-r--r--modules/commands/ns_set.cpp4
-rw-r--r--modules/commands/os_defcon.cpp2
-rw-r--r--modules/extra/m_ldap.cpp2
-rw-r--r--modules/extra/m_mysql.cpp2
-rw-r--r--modules/m_httpd.cpp2
-rw-r--r--modules/protocol/inspircd.cpp2
-rw-r--r--modules/pseudoclients/nickserv.cpp2
-rw-r--r--modules/webcpanel/pages/index.cpp8
-rw-r--r--modules/webcpanel/template_fileserver.h2
11 files changed, 16 insertions, 16 deletions
diff --git a/modules/commands/cs_flags.cpp b/modules/commands/cs_flags.cpp
index 020f42a7f..a241f6dbc 100644
--- a/modules/commands/cs_flags.cpp
+++ b/modules/commands/cs_flags.cpp
@@ -451,7 +451,7 @@ class CommandCSFlags : public Command
typedef std::multimap<char, Anope::string, ci::less> reverse_map;
reverse_map reverse;
for (std::map<Anope::string, char>::iterator it = defaultFlags.begin(), it_end = defaultFlags.end(); it != it_end; ++it)
- reverse.insert(std::make_pair(it->second, it->first));
+ reverse.emplace(it->second, it->first);
for (reverse_map::iterator it = reverse.begin(), it_end = reverse.end(); it != it_end; ++it)
{
diff --git a/modules/commands/cs_set.cpp b/modules/commands/cs_set.cpp
index 3081357d0..f424549b3 100644
--- a/modules/commands/cs_set.cpp
+++ b/modules/commands/cs_set.cpp
@@ -1138,9 +1138,9 @@ class CSSet : public Module
{
size_t c = modes.find(',');
if (c == Anope::string::npos)
- ci->last_modes.insert(std::make_pair(modes, ""));
+ ci->last_modes.emplace(modes, "");
else
- ci->last_modes.insert(std::make_pair(modes.substr(0, c), modes.substr(c + 1)));
+ ci->last_modes.emplace(modes.substr(0, c), modes.substr(c + 1));
}
}
} keep_modes;
diff --git a/modules/commands/ns_set.cpp b/modules/commands/ns_set.cpp
index 36fe49df1..b7588a495 100644
--- a/modules/commands/ns_set.cpp
+++ b/modules/commands/ns_set.cpp
@@ -1231,9 +1231,9 @@ class NSSet : public Module
{
size_t c = modes.find(',');
if (c == Anope::string::npos)
- nc->last_modes.insert(std::make_pair(modes, ""));
+ nc->last_modes.emplace(modes, "");
else
- nc->last_modes.insert(std::make_pair(modes.substr(0, c), modes.substr(c + 1)));
+ nc->last_modes.emplace(modes.substr(0, c), modes.substr(c + 1));
}
}
} keep_modes;
diff --git a/modules/commands/os_defcon.cpp b/modules/commands/os_defcon.cpp
index 2a9dcb4e3..7471eab29 100644
--- a/modules/commands/os_defcon.cpp
+++ b/modules/commands/os_defcon.cpp
@@ -72,7 +72,7 @@ struct DefconConfig
bool SetDefConParam(const Anope::string &name, const Anope::string &buf)
{
- return DefConModesOnParams.insert(std::make_pair(name, buf)).second;
+ return DefConModesOnParams.emplace(name, buf).second;
}
void UnsetDefConParam(const Anope::string &name)
diff --git a/modules/extra/m_ldap.cpp b/modules/extra/m_ldap.cpp
index b450df751..498477e3c 100644
--- a/modules/extra/m_ldap.cpp
+++ b/modules/extra/m_ldap.cpp
@@ -498,7 +498,7 @@ class ModuleLDAP : public Module, public Pipe
{
LDAPService *ss = new LDAPService(this, connname, server, admin_binddn, admin_password);
ss->Start();
- this->LDAPServices.insert(std::make_pair(connname, ss));
+ this->LDAPServices.emplace(connname, ss);
Log(LOG_NORMAL, "ldap") << "LDAP: Successfully initialized server " << connname << " (" << server << ")";
}
diff --git a/modules/extra/m_mysql.cpp b/modules/extra/m_mysql.cpp
index 136f1d086..b9a58b145 100644
--- a/modules/extra/m_mysql.cpp
+++ b/modules/extra/m_mysql.cpp
@@ -240,7 +240,7 @@ class ModuleSQL : public Module, public Pipe
try
{
MySQLService *ss = new MySQLService(this, connname, database, server, user, password, port);
- this->MySQLServices.insert(std::make_pair(connname, ss));
+ this->MySQLServices.emplace(connname, ss);
Log(LOG_NORMAL, "mysql") << "MySQL: Successfully connected to server " << connname << " (" << server << ")";
}
diff --git a/modules/m_httpd.cpp b/modules/m_httpd.cpp
index 63bfe7fd4..4ce4ba945 100644
--- a/modules/m_httpd.cpp
+++ b/modules/m_httpd.cpp
@@ -318,7 +318,7 @@ class MyHTTPProvider : public HTTPProvider, public Timer
bool RegisterPage(HTTPPage *page) override
{
- return this->pages.insert(std::make_pair(page->GetURL(), page)).second;
+ return this->pages.emplace(page->GetURL(), page).second;
}
void UnregisterPage(HTTPPage *page) override
diff --git a/modules/protocol/inspircd.cpp b/modules/protocol/inspircd.cpp
index 206cdfe1e..82e17a070 100644
--- a/modules/protocol/inspircd.cpp
+++ b/modules/protocol/inspircd.cpp
@@ -1378,7 +1378,7 @@ class IRCDMessageMetadata : IRCDMessage
Anope::string modechr, modelimit;
while (limitstream.GetToken(modechr) && limitstream.GetToken(modelimit))
{
- limits.insert(std::make_pair(modechr[0], convertTo<unsigned>(modelimit)));
+ limits.emplace(modechr[0], convertTo<unsigned>(modelimit));
}
maxlist.Set(c, limits);
}
diff --git a/modules/pseudoclients/nickserv.cpp b/modules/pseudoclients/nickserv.cpp
index 7d36ba7a1..49402ee05 100644
--- a/modules/pseudoclients/nickserv.cpp
+++ b/modules/pseudoclients/nickserv.cpp
@@ -96,7 +96,7 @@ class NickServRelease : public User, public Timer
delete nit->second;
}
- NickServReleases.insert(std::make_pair(this->nick, this));
+ NickServReleases.emplace(this->nick, this);
IRCD->SendClientIntroduction(this);
}
diff --git a/modules/webcpanel/pages/index.cpp b/modules/webcpanel/pages/index.cpp
index 2eee59e26..bb986ce54 100644
--- a/modules/webcpanel/pages/index.cpp
+++ b/modules/webcpanel/pages/index.cpp
@@ -60,15 +60,15 @@ class WebpanelRequest : public IdentifyRequest
{
HTTPReply::cookie c;
- c.push_back(std::make_pair("account", na->nick));
- c.push_back(std::make_pair("Path", "/"));
+ c.emplace_back("account", na->nick);
+ c.emplace_back("Path", "/");
reply.cookies.push_back(c);
}
{
HTTPReply::cookie c;
- c.push_back(std::make_pair("id", id));
- c.push_back(std::make_pair("Path", "/"));
+ c.emplace_back("id", id);
+ c.emplace_back("Path", "/");
reply.cookies.push_back(c);
}
diff --git a/modules/webcpanel/template_fileserver.h b/modules/webcpanel/template_fileserver.h
index b78b6966f..3d2e81937 100644
--- a/modules/webcpanel/template_fileserver.h
+++ b/modules/webcpanel/template_fileserver.h
@@ -18,7 +18,7 @@ class TemplateFileServer
{
Anope::string& operator[](const Anope::string &key)
{
- return insert(std::make_pair(key, ""))->second;
+ return emplace(key, "")->second;
}
};