Merge pull request #11749 from lioncash/copy

NetPlayServer: Prevent unnecessary copies in GetInterfaceSet()
This commit is contained in:
Admiral H. Curtiss 2023-04-11 22:09:56 +02:00 committed by GitHub
commit 31d2dedcb1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

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;
} }