diff options
author | bunnei <bunneidev@gmail.com> | 2018-10-10 04:29:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-10 04:29:39 +0200 |
commit | 3ac874c32ebba99c5d1402ea6b82277e7f303b93 (patch) | |
tree | fa616d3b0c8846a143916261f74278d6509233d4 /src/core/file_sys/patch_manager.cpp | |
parent | Merge pull request #1466 from lioncash/unused (diff) | |
parent | patch_manager: Return a std::unique_ptr from ParseControlNCA() and GetControlMetadata() instead of a std::shared_ptr (diff) | |
download | yuzu-3ac874c32ebba99c5d1402ea6b82277e7f303b93.tar yuzu-3ac874c32ebba99c5d1402ea6b82277e7f303b93.tar.gz yuzu-3ac874c32ebba99c5d1402ea6b82277e7f303b93.tar.bz2 yuzu-3ac874c32ebba99c5d1402ea6b82277e7f303b93.tar.lz yuzu-3ac874c32ebba99c5d1402ea6b82277e7f303b93.tar.xz yuzu-3ac874c32ebba99c5d1402ea6b82277e7f303b93.tar.zst yuzu-3ac874c32ebba99c5d1402ea6b82277e7f303b93.zip |
Diffstat (limited to 'src/core/file_sys/patch_manager.cpp')
-rw-r--r-- | src/core/file_sys/patch_manager.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/core/file_sys/patch_manager.cpp b/src/core/file_sys/patch_manager.cpp index b14d7cb0a..019caebe9 100644 --- a/src/core/file_sys/patch_manager.cpp +++ b/src/core/file_sys/patch_manager.cpp @@ -345,23 +345,22 @@ std::map<std::string, std::string, std::less<>> PatchManager::GetPatchVersionNam return out; } -std::pair<std::shared_ptr<NACP>, VirtualFile> PatchManager::GetControlMetadata() const { +std::pair<std::unique_ptr<NACP>, VirtualFile> PatchManager::GetControlMetadata() const { const auto& installed{Service::FileSystem::GetUnionContents()}; const auto base_control_nca = installed->GetEntry(title_id, ContentRecordType::Control); if (base_control_nca == nullptr) return {}; - return ParseControlNCA(base_control_nca); + return ParseControlNCA(*base_control_nca); } -std::pair<std::shared_ptr<NACP>, VirtualFile> PatchManager::ParseControlNCA( - const std::shared_ptr<NCA>& nca) const { - const auto base_romfs = nca->GetRomFS(); +std::pair<std::unique_ptr<NACP>, VirtualFile> PatchManager::ParseControlNCA(const NCA& nca) const { + const auto base_romfs = nca.GetRomFS(); if (base_romfs == nullptr) return {}; - const auto romfs = PatchRomFS(base_romfs, nca->GetBaseIVFCOffset(), ContentRecordType::Control); + const auto romfs = PatchRomFS(base_romfs, nca.GetBaseIVFCOffset(), ContentRecordType::Control); if (romfs == nullptr) return {}; @@ -373,7 +372,7 @@ std::pair<std::shared_ptr<NACP>, VirtualFile> PatchManager::ParseControlNCA( if (nacp_file == nullptr) nacp_file = extracted->GetFile("Control.nacp"); - const auto nacp = nacp_file == nullptr ? nullptr : std::make_shared<NACP>(nacp_file); + auto nacp = nacp_file == nullptr ? nullptr : std::make_unique<NACP>(nacp_file); VirtualFile icon_file; for (const auto& language : FileSys::LANGUAGE_NAMES) { @@ -382,6 +381,6 @@ std::pair<std::shared_ptr<NACP>, VirtualFile> PatchManager::ParseControlNCA( break; } - return {nacp, icon_file}; + return {std::move(nacp), icon_file}; } } // namespace FileSys |