diff options
author | bunnei <bunneidev@gmail.com> | 2021-06-24 00:31:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-24 00:31:04 +0200 |
commit | 1b09d6628b7f268c256c12e4d3e373724671d2f1 (patch) | |
tree | b1679d1c4bc044144798746332860939fe43d109 /src/core/file_sys/registered_cache.cpp | |
parent | Merge pull request #6504 from Kelebek1/samples-played (diff) | |
parent | General: Resolve fmt specifiers to adhere to 8.0.0 API where applicable (diff) | |
download | yuzu-1b09d6628b7f268c256c12e4d3e373724671d2f1.tar yuzu-1b09d6628b7f268c256c12e4d3e373724671d2f1.tar.gz yuzu-1b09d6628b7f268c256c12e4d3e373724671d2f1.tar.bz2 yuzu-1b09d6628b7f268c256c12e4d3e373724671d2f1.tar.lz yuzu-1b09d6628b7f268c256c12e4d3e373724671d2f1.tar.xz yuzu-1b09d6628b7f268c256c12e4d3e373724671d2f1.tar.zst yuzu-1b09d6628b7f268c256c12e4d3e373724671d2f1.zip |
Diffstat (limited to 'src/core/file_sys/registered_cache.cpp')
-rw-r--r-- | src/core/file_sys/registered_cache.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/core/file_sys/registered_cache.cpp b/src/core/file_sys/registered_cache.cpp index 066c6789a..7a646b5f1 100644 --- a/src/core/file_sys/registered_cache.cpp +++ b/src/core/file_sys/registered_cache.cpp @@ -58,14 +58,17 @@ 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, bool cnmt_suffix) { - if (!within_two_digit) - return fmt::format(cnmt_suffix ? "{}.cnmt.nca" : "/{}.nca", - Common::HexToString(nca_id, second_hex_upper)); + if (!within_two_digit) { + const auto format_str = fmt::runtime(cnmt_suffix ? "{}.cnmt.nca" : "/{}.nca"); + return fmt::format(format_str, Common::HexToString(nca_id, second_hex_upper)); + } Core::Crypto::SHA256Hash hash{}; mbedtls_sha256_ret(nca_id.data(), nca_id.size(), hash.data(), 0); - return fmt::format(cnmt_suffix ? "/000000{:02X}/{}.cnmt.nca" : "/000000{:02X}/{}.nca", hash[0], - Common::HexToString(nca_id, second_hex_upper)); + + const auto format_str = + fmt::runtime(cnmt_suffix ? "/000000{:02X}/{}.cnmt.nca" : "/000000{:02X}/{}.nca"); + return fmt::format(format_str, hash[0], Common::HexToString(nca_id, second_hex_upper)); } static std::string GetCNMTName(TitleType type, u64 title_id) { |