summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys
diff options
context:
space:
mode:
authorRodrigo Locatti <reinuseslisp@airmail.cc>2020-09-16 02:24:14 +0200
committerGitHub <noreply@github.com>2020-09-16 02:24:14 +0200
commit9cd1ea338b4936f58ea74a839a3beb9d998e55af (patch)
tree5730a53f2b5e113ac254bc408d7ff968f9da5242 /src/core/file_sys
parentMerge pull request #4655 from lioncash/internal2 (diff)
parentcheat_engine: Convert ExtractName into a non-template function (diff)
downloadyuzu-9cd1ea338b4936f58ea74a839a3beb9d998e55af.tar
yuzu-9cd1ea338b4936f58ea74a839a3beb9d998e55af.tar.gz
yuzu-9cd1ea338b4936f58ea74a839a3beb9d998e55af.tar.bz2
yuzu-9cd1ea338b4936f58ea74a839a3beb9d998e55af.tar.lz
yuzu-9cd1ea338b4936f58ea74a839a3beb9d998e55af.tar.xz
yuzu-9cd1ea338b4936f58ea74a839a3beb9d998e55af.tar.zst
yuzu-9cd1ea338b4936f58ea74a839a3beb9d998e55af.zip
Diffstat (limited to 'src/core/file_sys')
-rw-r--r--src/core/file_sys/patch_manager.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/core/file_sys/patch_manager.cpp b/src/core/file_sys/patch_manager.cpp
index 87c354a43..b9c09b456 100644
--- a/src/core/file_sys/patch_manager.cpp
+++ b/src/core/file_sys/patch_manager.cpp
@@ -76,8 +76,7 @@ VirtualDir FindSubdirectoryCaseless(const VirtualDir dir, std::string_view name)
}
std::optional<std::vector<Core::Memory::CheatEntry>> ReadCheatFileFromFolder(
- const Core::System& system, u64 title_id, const PatchManager::BuildID& build_id_,
- const VirtualDir& base_path, bool upper) {
+ u64 title_id, const PatchManager::BuildID& build_id_, const VirtualDir& base_path, bool upper) {
const auto build_id_raw = Common::HexToString(build_id_, upper);
const auto build_id = build_id_raw.substr(0, sizeof(u64) * 2);
const auto file = base_path->GetFile(fmt::format("{}.txt", build_id));
@@ -95,9 +94,8 @@ std::optional<std::vector<Core::Memory::CheatEntry>> ReadCheatFileFromFolder(
return std::nullopt;
}
- Core::Memory::TextCheatParser parser;
- return parser.Parse(system,
- std::string_view(reinterpret_cast<const char*>(data.data()), data.size()));
+ const Core::Memory::TextCheatParser parser;
+ return parser.Parse(std::string_view(reinterpret_cast<const char*>(data.data()), data.size()));
}
void AppendCommaIfNotEmpty(std::string& to, std::string_view with) {
@@ -335,14 +333,12 @@ std::vector<Core::Memory::CheatEntry> PatchManager::CreateCheatList(
auto cheats_dir = FindSubdirectoryCaseless(subdir, "cheats");
if (cheats_dir != nullptr) {
- auto res = ReadCheatFileFromFolder(system, title_id, build_id_, cheats_dir, true);
- if (res.has_value()) {
+ if (const auto res = ReadCheatFileFromFolder(title_id, build_id_, cheats_dir, true)) {
std::copy(res->begin(), res->end(), std::back_inserter(out));
continue;
}
- res = ReadCheatFileFromFolder(system, title_id, build_id_, cheats_dir, false);
- if (res.has_value()) {
+ if (const auto res = ReadCheatFileFromFolder(title_id, build_id_, cheats_dir, false)) {
std::copy(res->begin(), res->end(), std::back_inserter(out));
}
}