diff options
author | Zach Hilman <DarkLordZach@users.noreply.github.com> | 2019-06-15 22:47:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-15 22:47:13 +0200 |
commit | c140b6ae2ca6bc318f47b74a6946ddb10d282dbe (patch) | |
tree | 6407b0465b93a7cfc0a5733e0d8dd3bb26742a15 /src/core/file_sys/registered_cache.cpp | |
parent | Merge pull request #2582 from lioncash/reserved (diff) | |
parent | common/hex_util: Reserve std::string memory ahead of time (diff) | |
download | yuzu-c140b6ae2ca6bc318f47b74a6946ddb10d282dbe.tar yuzu-c140b6ae2ca6bc318f47b74a6946ddb10d282dbe.tar.gz yuzu-c140b6ae2ca6bc318f47b74a6946ddb10d282dbe.tar.bz2 yuzu-c140b6ae2ca6bc318f47b74a6946ddb10d282dbe.tar.lz yuzu-c140b6ae2ca6bc318f47b74a6946ddb10d282dbe.tar.xz yuzu-c140b6ae2ca6bc318f47b74a6946ddb10d282dbe.tar.zst yuzu-c140b6ae2ca6bc318f47b74a6946ddb10d282dbe.zip |
Diffstat (limited to 'src/core/file_sys/registered_cache.cpp')
-rw-r--r-- | src/core/file_sys/registered_cache.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/core/file_sys/registered_cache.cpp b/src/core/file_sys/registered_cache.cpp index 3946ff871..58917e094 100644 --- a/src/core/file_sys/registered_cache.cpp +++ b/src/core/file_sys/registered_cache.cpp @@ -53,13 +53,14 @@ static bool FollowsNcaIdFormat(std::string_view name) { static std::string GetRelativePathFromNcaID(const std::array<u8, 16>& nca_id, bool second_hex_upper, bool within_two_digit) { - if (!within_two_digit) - return fmt::format("/{}.nca", Common::HexArrayToString(nca_id, second_hex_upper)); + if (!within_two_digit) { + return fmt::format("/{}.nca", Common::HexToString(nca_id, second_hex_upper)); + } Core::Crypto::SHA256Hash hash{}; mbedtls_sha256(nca_id.data(), nca_id.size(), hash.data(), 0); return fmt::format("/000000{:02X}/{}.nca", hash[0], - Common::HexArrayToString(nca_id, second_hex_upper)); + Common::HexToString(nca_id, second_hex_upper)); } static std::string GetCNMTName(TitleType type, u64 title_id) { @@ -376,10 +377,11 @@ std::vector<ContentProviderEntry> RegisteredCache::ListEntriesFilter( } static std::shared_ptr<NCA> GetNCAFromNSPForID(const NSP& nsp, const NcaID& id) { - const auto file = nsp.GetFile(fmt::format("{}.nca", Common::HexArrayToString(id, false))); - if (file == nullptr) + auto file = nsp.GetFile(fmt::format("{}.nca", Common::HexToString(id, false))); + if (file == nullptr) { return nullptr; - return std::make_shared<NCA>(file); + } + return std::make_shared<NCA>(std::move(file)); } InstallResult RegisteredCache::InstallEntry(const XCI& xci, bool overwrite_if_exists, |