summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2021-06-29 08:35:30 +0200
committerJosJuice <josjuice@gmail.com>2021-06-30 09:06:20 +0200
commiteafa2784d6a321bcd2ff2cb38b1cc3f93811cc82 (patch)
treef0b6abfbf42f350fb42d96b5cb3fe6cc488692ee /Source/Core/DiscIO
parente6dfb08746d0a514dbafc75ea937ed92e8fdb79c (diff)
DiscIO: Store partition key directly in ReuseID
This lets us reuse blocks in the case where different partition entries use the same key (which probably isn't very common).
Diffstat (limited to 'Source/Core/DiscIO')
-rw-r--r--Source/Core/DiscIO/WIABlob.cpp4
-rw-r--r--Source/Core/DiscIO/WIABlob.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/Source/Core/DiscIO/WIABlob.cpp b/Source/Core/DiscIO/WIABlob.cpp
index 80e51cb256..91afea53cc 100644
--- a/Source/Core/DiscIO/WIABlob.cpp
+++ b/Source/Core/DiscIO/WIABlob.cpp
@@ -1305,7 +1305,7 @@ WIARVZFileReader<RVZ>::ProcessAndCompress(CompressThreadState* state, CompressPa
std::vector<u8>& data = parameters.data;
if (AllSame(data))
- entry.reuse_id = ReuseID{nullptr, data.size(), false, data.front()};
+ entry.reuse_id = ReuseID{WiiKey{}, data.size(), false, data.front()};
if constexpr (RVZ)
{
@@ -1344,7 +1344,7 @@ WIARVZFileReader<RVZ>::ProcessAndCompress(CompressThreadState* state, CompressPa
const auto create_reuse_id = [&partition_entry, blocks,
blocks_per_chunk](u8 value, bool encrypted, u64 block) {
const u64 size = std::min(blocks - block, blocks_per_chunk) * VolumeWii::BLOCK_DATA_SIZE;
- return ReuseID{&partition_entry.partition_key, size, encrypted, value};
+ return ReuseID{partition_entry.partition_key, size, encrypted, value};
};
const u8* parameters_data_end = parameters.data.data() + parameters.data.size();
diff --git a/Source/Core/DiscIO/WIABlob.h b/Source/Core/DiscIO/WIABlob.h
index bcd4c06b48..91922d9a63 100644
--- a/Source/Core/DiscIO/WIABlob.h
+++ b/Source/Core/DiscIO/WIABlob.h
@@ -258,7 +258,7 @@ private:
#undef COMPARE_TIED
- const WiiKey* partition_key;
+ WiiKey partition_key;
u64 data_size;
bool encrypted;
u8 value;