summaryrefslogtreecommitdiff
path: root/Source/Core/UICommon/GameFile.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-05-28 07:12:59 -0400
committerLioncash <mathew1800@gmail.com>2019-05-28 07:27:41 -0400
commit80786cd295426244068718d6553c5cb59abcb81f (patch)
treecd011ed0a3eb8f12ca91686da80ec25db0e663fb /Source/Core/UICommon/GameFile.cpp
parentab0892e5a59cd415e8e714d18a785d0047617d3a (diff)
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->
Diffstat (limited to 'Source/Core/UICommon/GameFile.cpp')
-rw-r--r--Source/Core/UICommon/GameFile.cpp11
1 files 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()