NetPlayServer: Prevent unnecessary copies in GetInterfaceSet()

This was previously copying each pair out of the vector returned by
GetInterfaceListInternal() when we just need to emplace the first entry
of each pair.
This commit is contained in:
Lioncash 2023-04-11 09:17:00 -04:00
parent af52b5a2d9
commit 81493ee910

View File

@ -2266,8 +2266,7 @@ u16 NetPlayServer::GetPort() const
std::unordered_set<std::string> NetPlayServer::GetInterfaceSet() const std::unordered_set<std::string> NetPlayServer::GetInterfaceSet() const
{ {
std::unordered_set<std::string> result; std::unordered_set<std::string> result;
auto lst = GetInterfaceListInternal(); for (const auto& list_entry : GetInterfaceListInternal())
for (auto list_entry : lst)
result.emplace(list_entry.first); result.emplace(list_entry.first);
return result; return result;
} }