diff options
| author | Lioncash <mathew1800@gmail.com> | 2019-06-10 23:02:48 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2019-06-10 23:27:05 -0400 |
| commit | 907c499608bba000f991dce59fb086e1a8287b81 (patch) | |
| tree | dab21ea260b19da8f3d923a278a19e400f049037 /src/core/file_sys/card_image.cpp | |
| parent | c305601f9bb2be0e280d3a2bf822002b8989a358 (diff) | |
file_sys/card_image: Deduplicate type cast
Same thing, less duplication. We can also std::move raw into the
PartitionFilesystem constructor.
Diffstat (limited to 'src/core/file_sys/card_image.cpp')
| -rw-r--r-- | src/core/file_sys/card_image.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/core/file_sys/card_image.cpp b/src/core/file_sys/card_image.cpp index fd00e5457a..4375e01fad 100644 --- a/src/core/file_sys/card_image.cpp +++ b/src/core/file_sys/card_image.cpp @@ -48,10 +48,12 @@ XCI::XCI(VirtualFile file_) for (XCIPartition partition : {XCIPartition::Update, XCIPartition::Normal, XCIPartition::Secure, XCIPartition::Logo}) { - auto raw = main_hfs.GetFile(partition_names[static_cast<std::size_t>(partition)]); - if (raw != nullptr) - partitions[static_cast<std::size_t>(partition)] = - std::make_shared<PartitionFilesystem>(raw); + const auto partition_idx = static_cast<std::size_t>(partition); + auto raw = main_hfs.GetFile(partition_names[partition_idx]); + + if (raw != nullptr) { + partitions[partition_idx] = std::make_shared<PartitionFilesystem>(std::move(raw)); + } } secure_partition = std::make_shared<NSP>( |
