From 0a67a40e7c8345925b6163d7c287691e7f49e387 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 4 Aug 2019 12:24:01 -0400 Subject: [PATCH] UICommon/NetPlayIndex: Move NetPlaySession variable closer to its usage point in List() Moves it closer to where its used, narrowing its visible scope, as well as preventing unnecessary std::string constructor executions in the event invalid data is encountered (the continue branch). --- Source/Core/UICommon/NetPlayIndex.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/Core/UICommon/NetPlayIndex.cpp b/Source/Core/UICommon/NetPlayIndex.cpp index f7cbd3f557..2c24ae41dc 100644 --- a/Source/Core/UICommon/NetPlayIndex.cpp +++ b/Source/Core/UICommon/NetPlayIndex.cpp @@ -86,8 +86,6 @@ NetPlayIndex::List(const std::map& filters) for (const auto& entry : entries.get()) { - NetPlaySession session; - const auto& name = entry.get("name"); const auto& region = entry.get("region"); const auto& method = entry.get("method"); @@ -107,6 +105,7 @@ NetPlayIndex::List(const std::map& filters) continue; } + NetPlaySession session; session.name = name.to_str(); session.region = region.to_str(); session.game_id = game_id.to_str();