From 5fa3d8f9297f50e25a7bad6a9bde91b9024330de Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 12 Sep 2022 20:33:21 +0100 Subject: Use emplace() instead of insert(std::make_pair()). --- modules/commands/cs_flags.cpp | 2 +- modules/commands/cs_set.cpp | 4 ++-- modules/commands/ns_set.cpp | 4 ++-- modules/commands/os_defcon.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'modules/commands') 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 reverse_map; reverse_map reverse; for (std::map::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) -- cgit