summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2020-09-15 15:10:55 +0200
committerLioncash <mathew1800@gmail.com>2020-09-15 15:10:58 +0200
commit66fc037ef2181cdddc1588032be18cb368fb3e97 (patch)
treedd29407fa8cb9e61683e3f0250a3d88b55910fdf /src/core/file_sys
parentnca_patch: Make SearchBucketEntry() internally linked (diff)
downloadyuzu-66fc037ef2181cdddc1588032be18cb368fb3e97.tar
yuzu-66fc037ef2181cdddc1588032be18cb368fb3e97.tar.gz
yuzu-66fc037ef2181cdddc1588032be18cb368fb3e97.tar.bz2
yuzu-66fc037ef2181cdddc1588032be18cb368fb3e97.tar.lz
yuzu-66fc037ef2181cdddc1588032be18cb368fb3e97.tar.xz
yuzu-66fc037ef2181cdddc1588032be18cb368fb3e97.tar.zst
yuzu-66fc037ef2181cdddc1588032be18cb368fb3e97.zip
Diffstat (limited to 'src/core/file_sys')
-rw-r--r--src/core/file_sys/nca_patch.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/file_sys/nca_patch.cpp b/src/core/file_sys/nca_patch.cpp
index fd7b69e11..5990a2fd5 100644
--- a/src/core/file_sys/nca_patch.cpp
+++ b/src/core/file_sys/nca_patch.cpp
@@ -14,10 +14,10 @@
namespace FileSys {
namespace {
template <bool Subsection, typename BlockType, typename BucketType>
-std::pair<std::size_t, std::size_t> SearchBucketEntry(u64 offset, BlockType block,
- BucketType buckets) {
+std::pair<std::size_t, std::size_t> SearchBucketEntry(u64 offset, const BlockType& block,
+ const BucketType& buckets) {
if constexpr (Subsection) {
- const auto last_bucket = buckets[block.number_buckets - 1];
+ const auto& last_bucket = buckets[block.number_buckets - 1];
if (offset >= last_bucket.entries[last_bucket.number_entries].address_patch) {
return {block.number_buckets - 1, last_bucket.number_entries};
}
@@ -29,7 +29,7 @@ std::pair<std::size_t, std::size_t> SearchBucketEntry(u64 offset, BlockType bloc
block.base_offsets.begin() + 1, block.base_offsets.begin() + block.number_buckets,
[&offset](u64 base_offset) { return base_offset <= offset; });
- const auto bucket = buckets[bucket_id];
+ const auto& bucket = buckets[bucket_id];
if (bucket.number_entries == 1) {
return {bucket_id, 0};