From 80786cd295426244068718d6553c5cb59abcb81f Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 28 May 2019 07:12:59 -0400 Subject: [PATCH] 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-> --- Source/Core/UICommon/GameFile.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Source/Core/UICommon/GameFile.cpp b/Source/Core/UICommon/GameFile.cpp index 328ba936d9..6cd07e4136 100644 --- a/Source/Core/UICommon/GameFile.cpp +++ b/Source/Core/UICommon/GameFile.cpp @@ -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()