From 2752183883604673e5058a3a6f62defcdca49a72 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 19 Sep 2018 14:16:22 -0400 Subject: 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. --- src/core/file_sys/xts_archive.cpp | 4 ++-- src/core/file_sys/xts_archive.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/core/file_sys/xts_archive.cpp b/src/core/file_sys/xts_archive.cpp index 55257da2e..6935d2fa2 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 NAX::AsNCA() const { +std::unique_ptr NAX::AsNCA() const { if (type == NAXContentType::NCA) - return std::make_shared(GetDecrypted()); + return std::make_unique(GetDecrypted()); return nullptr; } diff --git a/src/core/file_sys/xts_archive.h b/src/core/file_sys/xts_archive.h index 0dd0536f1..6e2fc4d2e 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 AsNCA() const; + std::unique_ptr AsNCA() const; NAXContentType GetContentType() const; -- cgit v1.2.3