diff --git a/Source/dvlnet/base.cpp b/Source/dvlnet/base.cpp index 3b4ffc88a..e35733499 100644 --- a/Source/dvlnet/base.cpp +++ b/Source/dvlnet/base.cpp @@ -69,7 +69,7 @@ void base::recv_local(packet &pkt) } switch (pkt.type()) { case PT_MESSAGE: - message_queue.push_back(message_t(pkt.src(), pkt.message())); + message_queue.emplace_back(pkt.src(), pkt.message()); break; case PT_TURN: turn_queue[pkt.src()].push_back(pkt.turn()); @@ -126,7 +126,7 @@ bool base::SNetSendMessage(int playerID, void *data, unsigned int size) auto raw_message = reinterpret_cast(data); buffer_t message(raw_message, raw_message + size); if (playerID == plr_self || playerID == SNPLAYER_ALL) - message_queue.push_back(message_t(plr_self, message)); + message_queue.emplace_back(plr_self, message); plr_t dest; if (playerID == SNPLAYER_ALL || playerID == SNPLAYER_OTHERS) dest = PLR_BROADCAST; diff --git a/Source/dvlnet/protocol_zt.cpp b/Source/dvlnet/protocol_zt.cpp index 9a345fc3f..9f1418916 100644 --- a/Source/dvlnet/protocol_zt.cpp +++ b/Source/dvlnet/protocol_zt.cpp @@ -192,7 +192,7 @@ bool protocol_zt::recv_from_udp() buffer_t data(buf, buf + len); endpoint ep; std::copy(in6.sin6_addr.s6_addr, in6.sin6_addr.s6_addr + 16, ep.addr.begin()); - oob_recv_queue.push_back(std::make_pair(ep, std::move(data))); + oob_recv_queue.emplace_back(ep, std::move(data)); return true; } diff --git a/Source/init.cpp b/Source/init.cpp index 8f6aee09b..2de446539 100644 --- a/Source/init.cpp +++ b/Source/init.cpp @@ -156,11 +156,11 @@ void init_archives() paths.pop_back(); #ifdef __linux__ - paths.push_back("/usr/share/diasurgical/devilutionx/"); - paths.push_back("/usr/local/share/diasurgical/devilutionx/"); + paths.emplace_back("/usr/share/diasurgical/devilutionx/"); + paths.emplace_back("/usr/local/share/diasurgical/devilutionx/"); #endif - paths.push_back(""); // PWD + paths.emplace_back(""); // PWD if (SDL_LOG_PRIORITY_VERBOSE >= SDL_LogGetPriority(SDL_LOG_CATEGORY_APPLICATION)) { std::string message;