summaryrefslogtreecommitdiff
path: root/src
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 /src
parent1a2da821064f8d869b999fb8e32ffeddfc82967b (diff)
Use emplace() instead of insert(std::make_pair()).
Diffstat (limited to 'src')
-rw-r--r--src/channels.cpp2
-rw-r--r--src/config.cpp2
-rw-r--r--src/modes.cpp2
-rw-r--r--src/timers.cpp2
-rw-r--r--src/xline.cpp2
5 files changed, 5 insertions, 5 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index 08998de77..a0afe6d39 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -304,7 +304,7 @@ void Channel::SetModeInternal(MessageSource &setter, ChannelMode *ocm, const Ano
else if (this->HasMode(cm->name, param))
return;
- this->modes.insert(std::make_pair(cm->name, param));
+ this->modes.emplace(cm->name, param);
if (param.empty() && cm->type != MODE_REGULAR)
{
diff --git a/src/config.cpp b/src/config.cpp
index d7b90a105..0d1900268 100644
--- a/src/config.cpp
+++ b/src/config.cpp
@@ -831,7 +831,7 @@ void Conf::LoadConf(File &file)
}
Block *b = block_stack.empty() ? this : block_stack.top();
- block_map::iterator it = b->blocks.insert(std::make_pair(wordbuffer, Configuration::Block(wordbuffer)));
+ block_map::iterator it = b->blocks.emplace(wordbuffer, Configuration::Block(wordbuffer));
b = &it->second;
b->linenum = linenumber;
block_stack.push(b);
diff --git a/src/modes.cpp b/src/modes.cpp
index b7a9ec8bf..150e0845b 100644
--- a/src/modes.cpp
+++ b/src/modes.cpp
@@ -297,7 +297,7 @@ void StackerInfo::AddMode(Mode *mode, bool set, const Anope::string &param)
}
/* Add this mode and its param to our list */
- list->push_back(std::make_pair(mode, param));
+ list->emplace_back(mode, param);
}
static class ModePipe : public Pipe
diff --git a/src/timers.cpp b/src/timers.cpp
index abb8bfeaf..cb4b8c0f9 100644
--- a/src/timers.cpp
+++ b/src/timers.cpp
@@ -80,7 +80,7 @@ Module *Timer::GetOwner() const
void TimerManager::AddTimer(Timer *t)
{
- Timers.insert(std::make_pair(t->GetTimer(), t));
+ Timers.emplace(t->GetTimer(), t);
}
void TimerManager::DelTimer(Timer *t)
diff --git a/src/xline.cpp b/src/xline.cpp
index ba402fe59..fb98f9b24 100644
--- a/src/xline.cpp
+++ b/src/xline.cpp
@@ -288,7 +288,7 @@ const std::vector<XLine *> &XLineManager::GetList() const
void XLineManager::AddXLine(XLine *x)
{
if (!x->id.empty())
- XLinesByUID->insert(std::make_pair(x->id, x));
+ XLinesByUID->emplace(x->id, x);
this->xlines->push_back(x);
x->manager = this;
}