summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-06-11 05:18:17 +0200
committerLioncash <mathew1800@gmail.com>2019-06-11 05:27:14 +0200
commit7bdef6106ee7b9dc30149f9c0d38c295d788bb0a (patch)
tree0385aaef78b80a5738232f7e934a9c39bf555db7 /src/core
parentfile_sys/card_image: Make bracing consistent (diff)
downloadyuzu-7bdef6106ee7b9dc30149f9c0d38c295d788bb0a.tar
yuzu-7bdef6106ee7b9dc30149f9c0d38c295d788bb0a.tar.gz
yuzu-7bdef6106ee7b9dc30149f9c0d38c295d788bb0a.tar.bz2
yuzu-7bdef6106ee7b9dc30149f9c0d38c295d788bb0a.tar.lz
yuzu-7bdef6106ee7b9dc30149f9c0d38c295d788bb0a.tar.xz
yuzu-7bdef6106ee7b9dc30149f9c0d38c295d788bb0a.tar.zst
yuzu-7bdef6106ee7b9dc30149f9c0d38c295d788bb0a.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/file_sys/card_image.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/file_sys/card_image.cpp b/src/core/file_sys/card_image.cpp
index 1a5faa43a..df9e0c434 100644
--- a/src/core/file_sys/card_image.cpp
+++ b/src/core/file_sys/card_image.cpp
@@ -176,11 +176,14 @@ VirtualDir XCI::GetParentDirectory() const {
}
Loader::ResultStatus XCI::AddNCAFromPartition(XCIPartition part) {
- if (partitions[static_cast<std::size_t>(part)] == nullptr) {
+ const auto partition_index = static_cast<std::size_t>(part);
+ const auto& partition = partitions[partition_index];
+
+ if (partition == nullptr) {
return Loader::ResultStatus::ErrorXCIMissingPartition;
}
- for (const VirtualFile& file : partitions[static_cast<std::size_t>(part)]->GetFiles()) {
+ for (const VirtualFile& file : partition->GetFiles()) {
if (file->GetExtension() != "nca") {
continue;
}
@@ -197,7 +200,7 @@ Loader::ResultStatus XCI::AddNCAFromPartition(XCIPartition part) {
} else {
const u16 error_id = static_cast<u16>(nca->GetStatus());
LOG_CRITICAL(Loader, "Could not load NCA {}/{}, failed with error code {:04X} ({})",
- partition_names[static_cast<std::size_t>(part)], nca->GetName(), error_id,
+ partition_names[partition_index], nca->GetName(), error_id,
nca->GetStatus());
}
}