aboutsummaryrefslogtreecommitdiff
path: root/src/core/file_sys/sdmc_factory.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-10-16 11:21:13 -0400
committerGitHub <noreply@github.com>2018-10-16 11:21:13 -0400
commit59c1ca8b0c0051a63d57ccb433a96909acf8000c (patch)
tree2df1a3b0722373a00173fae49df3be3c0445d92d /src/core/file_sys/sdmc_factory.cpp
parentd6e390bc5c944b8f2ce96b6d79533d60af172918 (diff)
parent39ae73b356a253036283b114855f8c5ddbb20f49 (diff)
Merge pull request #1508 from lioncash/unique-reg
file_sys/registered_cache: Use unique_ptr and regular pointers instead of shared_ptrs where applicable
Diffstat (limited to 'src/core/file_sys/sdmc_factory.cpp')
-rw-r--r--src/core/file_sys/sdmc_factory.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/file_sys/sdmc_factory.cpp b/src/core/file_sys/sdmc_factory.cpp
index d66a9c9a4..bd3a57058 100644
--- a/src/core/file_sys/sdmc_factory.cpp
+++ b/src/core/file_sys/sdmc_factory.cpp
@@ -10,10 +10,10 @@
namespace FileSys {
SDMCFactory::SDMCFactory(VirtualDir dir_)
- : dir(std::move(dir_)), contents(std::make_shared<RegisteredCache>(
+ : dir(std::move(dir_)), contents(std::make_unique<RegisteredCache>(
GetOrCreateDirectoryRelative(dir, "/Nintendo/Contents/registered"),
[](const VirtualFile& file, const NcaID& id) {
- return std::make_shared<NAX>(file, id)->GetDecrypted();
+ return NAX{file, id}.GetDecrypted();
})) {}
SDMCFactory::~SDMCFactory() = default;
@@ -22,8 +22,8 @@ ResultVal<VirtualDir> SDMCFactory::Open() {
return MakeResult<VirtualDir>(dir);
}
-std::shared_ptr<RegisteredCache> SDMCFactory::GetSDMCContents() const {
- return contents;
+RegisteredCache* SDMCFactory::GetSDMCContents() const {
+ return contents.get();
}
} // namespace FileSys