mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-22 10:51:50 -05:00
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.
This commit is contained in:
parent
45195a51a7
commit
2752183883
2 changed files with 3 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ public:
|
|||
|
||||
VirtualFile GetDecrypted() const;
|
||||
|
||||
std::shared_ptr<NCA> AsNCA() const;
|
||||
std::unique_ptr<NCA> AsNCA() const;
|
||||
|
||||
NAXContentType GetContentType() const;
|
||||
|
||||
|
|
Loading…
Reference in a new issue