aboutsummaryrefslogtreecommitdiff
path: root/src/core/file_sys/content_archive.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-10-16 12:08:15 -0400
committerLioncash <mathew1800@gmail.com>2018-10-16 12:08:17 -0400
commit067a174e00e0a12d53bb6cfb43246e3356a89a33 (patch)
tree7f8c262d13e77edad6e32d8d1f2cfe3670e1ea91 /src/core/file_sys/content_archive.cpp
parent57e652436aec3511553f6b908feee03af4114bbd (diff)
content_archive: Pass and take NCASectionHeader instance by reference
Each header is 512 bytes in size, which is kind of an excessive amount to copy all the time when it's possible to avoid doing so.
Diffstat (limited to 'src/core/file_sys/content_archive.cpp')
-rw-r--r--src/core/file_sys/content_archive.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/file_sys/content_archive.cpp b/src/core/file_sys/content_archive.cpp
index 6dcec78161..0872a378bc 100644
--- a/src/core/file_sys/content_archive.cpp
+++ b/src/core/file_sys/content_archive.cpp
@@ -167,7 +167,7 @@ boost::optional<Core::Crypto::Key128> NCA::GetTitlekey() {
return titlekey;
}
-VirtualFile NCA::Decrypt(NCASectionHeader s_header, VirtualFile in, u64 starting_offset) {
+VirtualFile NCA::Decrypt(const NCASectionHeader& s_header, VirtualFile in, u64 starting_offset) {
if (!encrypted)
return in;
@@ -295,7 +295,7 @@ NCA::NCA(VirtualFile file_, VirtualFile bktr_base_romfs_, u64 bktr_base_ivfc_off
ivfc_offset = 0;
for (std::ptrdiff_t i = 0; i < number_sections; ++i) {
- auto section = sections[i];
+ const auto& section = sections[i];
if (section.raw.header.filesystem_type == NCASectionFilesystemType::ROMFS) {
const std::size_t base_offset =