UICommon/GameFile: Remove unnecessary value() calls in DownloadDefaultCover()

We already check ahead of time if the optional contains a value within
it before accessing it, so we don't need to use the throwing value()
accessor. We can just directly use operator->
This commit is contained in:
Lioncash 2019-05-28 07:12:59 -04:00
parent ab0892e5a5
commit 80786cd295
1 changed files with 5 additions and 6 deletions

View File

@ -258,14 +258,13 @@ void GameFile::DownloadDefaultCover()
}
Common::HttpRequest request;
auto response =
const auto response =
request.Get(StringFromFormat(COVER_URL, region_code.c_str(), m_gametdb_id.c_str()));
if (response)
{
File::WriteStringToFile(std::string(response.value().begin(), response.value().end()),
png_path);
}
if (!response)
return;
File::WriteStringToFile(std::string(response->begin(), response->end()), png_path);
}
bool GameFile::DefaultCoverChanged()