Skip to content

Commit

Permalink
UICommon/NetPlayIndex: Move NetPlaySession variable closer to its usa…
Browse files Browse the repository at this point in the history
…ge 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).
  • Loading branch information
lioncash committed Aug 4, 2019
1 parent 1329256 commit 0a67a40
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Source/Core/UICommon/NetPlayIndex.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ NetPlayIndex::List(const std::map<std::string, std::string>& filters)


for (const auto& entry : entries.get<picojson::array>()) for (const auto& entry : entries.get<picojson::array>())
{ {
NetPlaySession session;

const auto& name = entry.get("name"); const auto& name = entry.get("name");
const auto& region = entry.get("region"); const auto& region = entry.get("region");
const auto& method = entry.get("method"); const auto& method = entry.get("method");
Expand All @@ -107,6 +105,7 @@ NetPlayIndex::List(const std::map<std::string, std::string>& filters)
continue; continue;
} }


NetPlaySession session;
session.name = name.to_str(); session.name = name.to_str();
session.region = region.to_str(); session.region = region.to_str();
session.game_id = game_id.to_str(); session.game_id = game_id.to_str();
Expand Down

0 comments on commit 0a67a40

Please sign in to comment.