From a62088539ed02a8569814601b3b99b713c5d8a34 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 12 Jun 2019 17:27:06 -0400 Subject: common/hex_util: Combine HexVectorToString() and HexArrayToString() These can be generified together by using a concept type to designate them. This also has the benefit of not making copies of potentially very large arrays. --- src/core/file_sys/patch_manager.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/core/file_sys/patch_manager.cpp') diff --git a/src/core/file_sys/patch_manager.cpp b/src/core/file_sys/patch_manager.cpp index 78dbadee3..da823c37b 100644 --- a/src/core/file_sys/patch_manager.cpp +++ b/src/core/file_sys/patch_manager.cpp @@ -142,7 +142,7 @@ std::vector PatchManager::CollectPatches(const std::vector PatchManager::PatchNSO(const std::vector& nso, const std::st return nso; } - const auto build_id_raw = Common::HexArrayToString(header.build_id); + const auto build_id_raw = Common::HexToString(header.build_id); const auto build_id = build_id_raw.substr(0, build_id_raw.find_last_not_of('0') + 1); if (Settings::values.dump_nso) { @@ -219,7 +219,7 @@ std::vector PatchManager::PatchNSO(const std::vector& nso, const std::st } bool PatchManager::HasNSOPatch(const std::array& build_id_) const { - const auto build_id_raw = Common::HexArrayToString(build_id_); + const auto build_id_raw = Common::HexToString(build_id_); const auto build_id = build_id_raw.substr(0, build_id_raw.find_last_not_of('0') + 1); LOG_INFO(Loader, "Querying NSO patch existence for build_id={}", build_id); @@ -235,7 +235,7 @@ bool PatchManager::HasNSOPatch(const std::array& build_id_) const { static std::optional ReadCheatFileFromFolder(const Core::System& system, u64 title_id, const std::array& build_id_, const VirtualDir& base_path, bool upper) { - const auto build_id_raw = Common::HexArrayToString(build_id_, 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)); -- cgit v1.2.3