diff options
| author | 2019-06-10 23:02:48 -0400 | |
|---|---|---|
| committer | 2019-06-10 23:27:05 -0400 | |
| commit | 288d027e892959f84cb0aead7570f8f789663f3a (patch) | |
| tree | dab21ea260b19da8f3d923a278a19e400f049037 /src | |
| parent | file_sys/card_image: Get rid of a magic number (diff) | |
| download | yuzu-288d027e892959f84cb0aead7570f8f789663f3a.tar.gz yuzu-288d027e892959f84cb0aead7570f8f789663f3a.tar.xz yuzu-288d027e892959f84cb0aead7570f8f789663f3a.zip | |
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')
| -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 fd00e5457..4375e01fa 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_) | |||
| 48 | 48 | ||
| 49 | for (XCIPartition partition : | 49 | for (XCIPartition partition : |
| 50 | {XCIPartition::Update, XCIPartition::Normal, XCIPartition::Secure, XCIPartition::Logo}) { | 50 | {XCIPartition::Update, XCIPartition::Normal, XCIPartition::Secure, XCIPartition::Logo}) { |
| 51 | auto raw = main_hfs.GetFile(partition_names[static_cast<std::size_t>(partition)]); | 51 | const auto partition_idx = static_cast<std::size_t>(partition); |
| 52 | if (raw != nullptr) | 52 | auto raw = main_hfs.GetFile(partition_names[partition_idx]); |
| 53 | partitions[static_cast<std::size_t>(partition)] = | 53 | |
| 54 | std::make_shared<PartitionFilesystem>(raw); | 54 | if (raw != nullptr) { |
| 55 | partitions[partition_idx] = std::make_shared<PartitionFilesystem>(std::move(raw)); | ||
| 56 | } | ||
| 55 | } | 57 | } |
| 56 | 58 | ||
| 57 | secure_partition = std::make_shared<NSP>( | 59 | secure_partition = std::make_shared<NSP>( |