mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-25 06:40:11 +00:00
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).
This commit is contained in:
parent
13292563ee
commit
0a67a40e7c
@ -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");
|
||||||
@ -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();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user