summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2022-01-04 12:28:55 +0000
committerSadie Powell <sadie@witchery.services>2022-01-04 12:28:55 +0000
commit106750db77be01c7b2d277a12d9b80de15cb8fbb (patch)
tree87df7f8b5966ca704f20ee7ab6a79b45ed2e95a2 /src
parent7d1047490e4380c4f02900b711c66055d29fb387 (diff)
Replace all uses of push_back with emplace_back.
Diffstat (limited to 'src')
-rw-r--r--src/config.cpp2
-rw-r--r--src/init.cpp2
-rw-r--r--src/messages.cpp2
-rw-r--r--src/misc.cpp4
4 files changed, 5 insertions, 5 deletions
diff --git a/src/config.cpp b/src/config.cpp
index f323ae6c7..502cb3bac 100644
--- a/src/config.cpp
+++ b/src/config.cpp
@@ -199,7 +199,7 @@ Conf::Conf() : Block(""), EmptyBlock("")
if (password.find(' ') != Anope::string::npos || password[0] == ':')
throw ConfigException("uplink:password is not valid");
- this->Uplinks.push_back(Uplink(host, port, password, ipv6));
+ this->Uplinks.emplace_back(host, port, password, ipv6);
}
for (int i = 0; i < this->CountBlock("module"); ++i)
diff --git a/src/init.cpp b/src/init.cpp
index 42cba3f10..48e3ebbfc 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -57,7 +57,7 @@ static void ParseCommandLineArguments(int ac, char **av)
if (option.empty())
continue;
- CommandLineArguments.push_back(std::make_pair(option, param));
+ CommandLineArguments.emplace_back(option, param);
}
}
diff --git a/src/messages.cpp b/src/messages.cpp
index 3a5c636c6..c0c41b31b 100644
--- a/src/messages.cpp
+++ b/src/messages.cpp
@@ -92,7 +92,7 @@ void Join::Run(MessageSource &source, const std::vector<Anope::string> &params,
}
std::list<SJoinUser> users;
- users.push_back(std::make_pair(ChannelStatus(), user));
+ users.emplace_back(ChannelStatus(), user);
Channel *chan = Channel::Find(channel);
SJoin(source, channel, chan ? chan->creation_time : Anope::CurTime, "", users);
diff --git a/src/misc.cpp b/src/misc.cpp
index ff1b05b02..11f038710 100644
--- a/src/misc.cpp
+++ b/src/misc.cpp
@@ -143,7 +143,7 @@ void ListFormatter::Process(std::vector<Anope::string> &buffer)
std::set<Anope::string> breaks;
for (unsigned i = 0; i < this->columns.size(); ++i)
{
- tcolumns.push_back(Language::Translate(this->nc, this->columns[i].c_str()));
+ tcolumns.emplace_back(Language::Translate(this->nc, this->columns[i].c_str()));
lengths[this->columns[i]] = tcolumns[i].length();
}
for (unsigned i = 0; i < this->entries.size(); ++i)
@@ -234,7 +234,7 @@ Anope::string& InfoFormatter::operator[](const Anope::string &key)
Anope::string tkey = Language::Translate(this->nc, key.c_str());
if (tkey.length() > this->longest)
this->longest = tkey.length();
- this->replies.push_back(std::make_pair(tkey, ""));
+ this->replies.emplace_back(tkey, "");
return this->replies.back().second;
}