summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-08-04 12:29:15 -0400
committerLioncash <mathew1800@gmail.com>2019-08-04 12:29:17 -0400
commit2830fe820d8eadb333ca6dbdf2f12c902a7f7ed2 (patch)
tree433be4bb4f8d8c940dab4a81ab2012890280ac08 /Source/Core
parent0a67a40e7c8345925b6163d7c287691e7f49e387 (diff)
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.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/UICommon/NetPlayIndex.cpp2
-rw-r--r--Source/Core/UICommon/NetPlayIndex.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/Source/Core/UICommon/NetPlayIndex.cpp b/Source/Core/UICommon/NetPlayIndex.cpp
index 2c24ae41dc..c528c8f5e2 100644
--- a/Source/Core/UICommon/NetPlayIndex.cpp
+++ b/Source/Core/UICommon/NetPlayIndex.cpp
@@ -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(
diff --git a/Source/Core/UICommon/NetPlayIndex.h b/Source/Core/UICommon/NetPlayIndex.h
index f451301152..a94e7daf35 100644
--- a/Source/Core/UICommon/NetPlayIndex.h
+++ b/Source/Core/UICommon/NetPlayIndex.h
@@ -44,7 +44,7 @@ public:
static std::vector<std::pair<std::string, std::string>> GetRegions();
- bool Add(NetPlaySession session);
+ bool Add(const NetPlaySession& session);
void Remove();
bool HasActiveSession() const;