From 2830fe820d8eadb333ca6dbdf2f12c902a7f7ed2 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 4 Aug 2019 12:29:15 -0400 Subject: [PATCH] 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. --- Source/Core/UICommon/NetPlayIndex.cpp | 2 +- Source/Core/UICommon/NetPlayIndex.h | 2 +- 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> GetRegions(); - bool Add(NetPlaySession session); + bool Add(const NetPlaySession& session); void Remove(); bool HasActiveSession() const;