summaryrefslogtreecommitdiff
path: root/modules/commands
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/commands
parent1a2da821064f8d869b999fb8e32ffeddfc82967b (diff)
Use emplace() instead of insert(std::make_pair()).
Diffstat (limited to 'modules/commands')
-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
4 files changed, 6 insertions, 6 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)