Skip to content
Permalink
Browse files

UICommon/NetPlayIndex: Take NetPlaySession by const reference for Add()

This isn't std::moved wholesale into a member variable or further
std::moved into another function, so it's better to take it by const
reference here to avoid unnecessary reallocations of contained
std::string instances.
  • Loading branch information...
lioncash committed Aug 4, 2019
1 parent 0a67a40 commit 2830fe820d8eadb333ca6dbdf2f12c902a7f7ed2
Showing with 2 additions and 2 deletions.
  1. +1 −1 Source/Core/UICommon/NetPlayIndex.cpp
  2. +1 −1 Source/Core/UICommon/NetPlayIndex.h
@@ -159,7 +159,7 @@ void NetPlayIndex::NotificationLoop()
}
}

bool NetPlayIndex::Add(NetPlaySession session)
bool NetPlayIndex::Add(const NetPlaySession& session)
{
Common::HttpRequest request;
auto response = request.Get(
@@ -44,7 +44,7 @@ class NetPlayIndex

static std::vector<std::pair<std::string, std::string>> GetRegions();

bool Add(NetPlaySession session);
bool Add(const NetPlaySession& session);
void Remove();

bool HasActiveSession() const;

0 comments on commit 2830fe8

Please sign in to comment.
You can’t perform that action at this time.