summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/DirectoryBlob.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2024-10-15 17:08:55 +0200
committerGitHub <noreply@github.com>2024-10-15 17:08:55 +0200
commit07605bf67c6815510688ebf3e71583624c3bfab0 (patch)
tree45d3c7260daf088cbf44febda937f1a4c34c5141 /Source/Core/DiscIO/DirectoryBlob.cpp
parentef8b753cd778179e1c2980b1ec2615f80a314714 (diff)
parente572081ac322253d65bf767a88887fedd4e97c2e (diff)
Merge pull request #13090 from mitaclaw/ranges-modernization-1-trivial
Ranges Algorithms Modernization - Trivial
Diffstat (limited to 'Source/Core/DiscIO/DirectoryBlob.cpp')
-rw-r--r--Source/Core/DiscIO/DirectoryBlob.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/Source/Core/DiscIO/DirectoryBlob.cpp b/Source/Core/DiscIO/DirectoryBlob.cpp
index 8129684575..130175f1ca 100644
--- a/Source/Core/DiscIO/DirectoryBlob.cpp
+++ b/Source/Core/DiscIO/DirectoryBlob.cpp
@@ -623,16 +623,15 @@ void DirectoryBlobReader::SetWiiRegionData(const std::vector<u8>& wii_region_dat
void DirectoryBlobReader::SetPartitions(std::vector<PartitionWithType>&& partitions)
{
- std::sort(partitions.begin(), partitions.end(),
- [](const PartitionWithType& lhs, const PartitionWithType& rhs) {
- if (lhs.type == rhs.type)
- return lhs.partition.GetRootDirectory() < rhs.partition.GetRootDirectory();
-
- // Ascending sort by partition type, except Update (1) comes before before Game (0)
- return (lhs.type > PartitionType::Update || rhs.type > PartitionType::Update) ?
- lhs.type < rhs.type :
- lhs.type > rhs.type;
- });
+ std::ranges::sort(partitions, [](const PartitionWithType& lhs, const PartitionWithType& rhs) {
+ if (lhs.type == rhs.type)
+ return lhs.partition.GetRootDirectory() < rhs.partition.GetRootDirectory();
+
+ // Ascending sort by partition type, except Update (1) comes before before Game (0)
+ return (lhs.type > PartitionType::Update || rhs.type > PartitionType::Update) ?
+ lhs.type < rhs.type :
+ lhs.type > rhs.type;
+ });
u32 subtable_1_size = 0;
while (subtable_1_size < partitions.size() && subtable_1_size < 3 &&