aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-09-19 14:16:22 -0400
committerLioncash <mathew1800@gmail.com>2018-09-19 14:22:37 -0400
commitd2736c4ddcf4bfd8a8218e61147c6e6dbd5797b9 (patch)
treef475ccc696f50a34016f788412daa868c2759dd8 /src
parent2eeb830edb109856f8db4cc315a7ce3c8f0887e2 (diff)
xts_archive: Make AsNCA() return a std::unique_ptr instead of a std::shared_ptr
std::shared_ptr isn't strictly necessary here and is only ever used in contexts where the object doesn't depend on being shared. This also makes the interface more flexible, as it's possible to create a std::shared_ptr from a std::unique_ptr (std::shared_ptr has a constructor that accepts a std::unique_ptr), but not the other way around.
Diffstat (limited to 'src')
-rw-r--r--src/core/file_sys/xts_archive.cpp4
-rw-r--r--src/core/file_sys/xts_archive.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/core/file_sys/xts_archive.cpp b/src/core/file_sys/xts_archive.cpp
index 55257da2e3..6935d2fa22 100644
--- a/src/core/file_sys/xts_archive.cpp
+++ b/src/core/file_sys/xts_archive.cpp
@@ -138,9 +138,9 @@ VirtualFile NAX::GetDecrypted() const {
return dec_file;
}
-std::shared_ptr<NCA> NAX::AsNCA() const {
+std::unique_ptr<NCA> NAX::AsNCA() const {
if (type == NAXContentType::NCA)
- return std::make_shared<NCA>(GetDecrypted());
+ return std::make_unique<NCA>(GetDecrypted());
return nullptr;
}
diff --git a/src/core/file_sys/xts_archive.h b/src/core/file_sys/xts_archive.h
index 0dd0536f18..6e2fc4d2e0 100644
--- a/src/core/file_sys/xts_archive.h
+++ b/src/core/file_sys/xts_archive.h
@@ -38,7 +38,7 @@ public:
VirtualFile GetDecrypted() const;
- std::shared_ptr<NCA> AsNCA() const;
+ std::unique_ptr<NCA> AsNCA() const;
NAXContentType GetContentType() const;