diff --git a/Source/Core/Common/FileSearch.cpp b/Source/Core/Common/FileSearch.cpp index 31b5e3cd37..4a54c978c9 100644 --- a/Source/Core/Common/FileSearch.cpp +++ b/Source/Core/Common/FileSearch.cpp @@ -97,7 +97,7 @@ std::vector DoFileSearch(const std::vector& directorie // Remove duplicates (occurring because caller gave e.g. duplicate or overlapping directories - // not because std::filesystem returns duplicates). Also note that this pathname-based uniqueness // isn't as thorough as std::filesystem::equivalent. - std::sort(result.begin(), result.end()); + std::ranges::sort(result); result.erase(std::unique(result.begin(), result.end()), result.end()); // Dolphin expects to be able to use "/" (DIR_SEP) everywhere. diff --git a/Source/Core/DiscIO/DirectoryBlob.cpp b/Source/Core/DiscIO/DirectoryBlob.cpp index 7cd7e12def..b9e8b89dd4 100644 --- a/Source/Core/DiscIO/DirectoryBlob.cpp +++ b/Source/Core/DiscIO/DirectoryBlob.cpp @@ -624,16 +624,15 @@ void DirectoryBlobReader::SetWiiRegionData(const std::vector& wii_region_dat void DirectoryBlobReader::SetPartitions(std::vector&& 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(); + 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; - }); + // 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 && diff --git a/Source/Core/DolphinQt/Debugger/WatchWidget.cpp b/Source/Core/DolphinQt/Debugger/WatchWidget.cpp index 170bfcc792..7cc61d1334 100644 --- a/Source/Core/DolphinQt/Debugger/WatchWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/WatchWidget.cpp @@ -481,7 +481,7 @@ void WatchWidget::DeleteSelectedWatches() } // Sort greatest to smallest, so we don't stomp on existing indices - std::sort(row_indices.begin(), row_indices.end(), std::greater{}); + std::ranges::sort(row_indices, std::ranges::greater{}); for (const int row : row_indices) { DeleteWatch(guard, row); diff --git a/Source/Core/InputCommon/ControllerInterface/MappingCommon.cpp b/Source/Core/InputCommon/ControllerInterface/MappingCommon.cpp index 4acee6a970..1877e8294c 100644 --- a/Source/Core/InputCommon/ControllerInterface/MappingCommon.cpp +++ b/Source/Core/InputCommon/ControllerInterface/MappingCommon.cpp @@ -101,7 +101,7 @@ BuildExpression(const std::vector } else { - std::sort(alternation.begin(), alternation.end()); + std::ranges::sort(alternation); alternations.push_back(fmt::to_string(fmt::join(alternation, "&"))); } }; @@ -128,7 +128,7 @@ BuildExpression(const std::vector handle_release(); // Remove duplicates - std::sort(alternations.begin(), alternations.end()); + std::ranges::sort(alternations); alternations.erase(std::unique(alternations.begin(), alternations.end()), alternations.end()); return fmt::to_string(fmt::join(alternations, "|")); diff --git a/Source/Core/VideoCommon/BPFunctions.cpp b/Source/Core/VideoCommon/BPFunctions.cpp index ecb045e6ad..2c6c733710 100644 --- a/Source/Core/VideoCommon/BPFunctions.cpp +++ b/Source/Core/VideoCommon/BPFunctions.cpp @@ -151,7 +151,7 @@ ScissorResult::ScissorResult(const BPMemory& bpmemory, std::pair v } auto cmp = [&](const ScissorRect& lhs, const ScissorRect& rhs) { return IsWorse(lhs, rhs); }; - std::sort(m_result.begin(), m_result.end(), cmp); + std::ranges::sort(m_result, cmp); } ScissorRect ScissorResult::Best() const