From 85e102c40ffeed4d0ef58fb6070510f3f45b56dd Mon Sep 17 00:00:00 2001
From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com>
Date: Sun, 3 Sep 2023 17:58:06 +0300
Subject: [PATCH] Change vector to unique_ptr

---
 src/core/fs/archive_self_ncch.cpp | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/core/fs/archive_self_ncch.cpp b/src/core/fs/archive_self_ncch.cpp
index 9b572f96..9c911769 100644
--- a/src/core/fs/archive_self_ncch.cpp
+++ b/src/core/fs/archive_self_ncch.cpp
@@ -71,7 +71,7 @@ std::optional<u32> SelfNCCHArchive::readFile(FileSession* file, u64 offset, u32
 
 	bool success = false;
 	std::size_t bytesRead = 0;
-	std::vector<u8> data;
+	std::unique_ptr<u8[]> data(new u8[size]);
 
 	if (auto cxi = mem.getCXI(); cxi != nullptr) {
 		IOFile& ioFile = mem.CXIFile;
@@ -122,7 +122,6 @@ std::optional<u32> SelfNCCHArchive::readFile(FileSession* file, u64 offset, u32
 			default: Helpers::panic("Unimplemented file path type for SelfNCCH archive");
 		}
 
-		data.resize(size);
 		std::tie(success, bytesRead) = cxi->readFromFile(ioFile, fsInfo, &data[0], offset, size);
 	}
 
@@ -139,7 +138,6 @@ std::optional<u32> SelfNCCHArchive::readFile(FileSession* file, u64 offset, u32
 			default: Helpers::panic("Unimplemented file path type for 3DSX SelfNCCH archive");
 		}
 
-		data.resize(size);
 		std::tie(success, bytesRead) = hb3dsx->readRomFSBytes(&data[0], offset, size);
 	}