[Cleanup] Cleanup uses of insert/push_back when a temp object is used. (#3170)

This commit is contained in:
Aeadoin
2023-04-03 16:45:01 -04:00
committed by GitHub
parent 2bb15271c5
commit f752b57a55
42 changed files with 104 additions and 104 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ LoginServerList::~LoginServerList() {
void LoginServerList::Add(const char* iAddress, uint16 iPort, const char* Account, const char* Password, bool Legacy)
{
auto loginserver = new LoginServer(iAddress, iPort, Account, Password, Legacy);
m_list.push_back(std::unique_ptr<LoginServer>(loginserver));
m_list.emplace_back(std::unique_ptr<LoginServer>(loginserver));
}
bool LoginServerList::SendStatus() {
+1 -1
View File
@@ -21,7 +21,7 @@ void QueryServConnection::AddConnection(std::shared_ptr<EQ::Net::ServertalkServe
//Set handlers
connection->OnMessage(ServerOP_QueryServGeneric, std::bind(&QueryServConnection::HandleGenericMessage, this, std::placeholders::_1, std::placeholders::_2));
connection->OnMessage(ServerOP_LFGuildUpdate, std::bind(&QueryServConnection::HandleLFGuildUpdateMessage, this, std::placeholders::_1, std::placeholders::_2));
m_streams.insert(std::make_pair(connection->GetUUID(), connection));
m_streams.emplace(std::make_pair(connection->GetUUID(), connection));
m_keepalive = std::make_unique<EQ::Timer>(1000, true, std::bind(&QueryServConnection::OnKeepAlive, this, std::placeholders::_1));
}
+1 -1
View File
@@ -1545,7 +1545,7 @@ bool SharedTaskManager::CanAddPlayer(SharedTask *s, uint32_t character_id, std::
void SharedTaskManager::RecordSharedTaskCompletion(SharedTask *s)
{
// shared task
auto t = s->GetDbSharedTask();
auto& t = s->GetDbSharedTask();
auto ct = CompletedSharedTasksRepository::NewEntity();
ct.id = t.id;
+2 -2
View File
@@ -123,7 +123,7 @@ void WebInterface::SendEvent(const Json::Value &value)
void WebInterface::AddCall(const std::string &method, WebInterfaceCall call)
{
m_calls.insert(std::make_pair(method, call));
m_calls.emplace(std::make_pair(method, call));
}
void WebInterface::SendResponse(const std::string &id, const Json::Value &response)
@@ -146,7 +146,7 @@ WebInterfaceList::~WebInterfaceList()
void WebInterfaceList::AddConnection(std::shared_ptr<EQ::Net::ServertalkServerConnection> connection)
{
m_interfaces.insert(std::make_pair(connection->GetUUID(), std::make_unique<WebInterface>(connection)));
m_interfaces.emplace(std::make_pair(connection->GetUUID(), std::make_unique<WebInterface>(connection)));
}
void WebInterfaceList::RemoveConnection(std::shared_ptr<EQ::Net::ServertalkServerConnection> connection)
+1 -1
View File
@@ -64,7 +64,7 @@ void ZSList::ShowUpTime(WorldTCPConnection* con, const char* adminname) {
}
void ZSList::Add(ZoneServer* zoneserver) {
zone_server_list.push_back(std::unique_ptr<ZoneServer>(zoneserver));
zone_server_list.emplace_back(std::unique_ptr<ZoneServer>(zoneserver));
zoneserver->SendGroupIDs();
}