mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Modernize std::sort
with ranges and projections
In PPCTables.cpp, the code is currently unused so I was unable to test it. In CustomPipeline.cpp, a pointer to member function cannot be used due to 16.4.5.2.1 of the C++ Standard regarding "addressable functions". https://eel.is/c++draft/namespace.std#6 In Fs.cpp and DirectoryBlob.cpp, these examples used projections in a previous iteration of this commit, but no longer do. Still, they remain in this commit because the PR they would actually belong to is already merged.
This commit is contained in:
@ -2026,8 +2026,7 @@ void TextureCacheBase::StitchXFBCopy(RcTcacheEntry& stitched_entry)
|
||||
if (candidates.empty())
|
||||
return;
|
||||
|
||||
std::sort(candidates.begin(), candidates.end(),
|
||||
[](const TCacheEntry* a, const TCacheEntry* b) { return a->id < b->id; });
|
||||
std::ranges::sort(candidates, {}, &TCacheEntry::id);
|
||||
|
||||
// We only upscale when necessary to preserve resolution. i.e. when there are upscaled partial
|
||||
// copies to be stitched together.
|
||||
|
Reference in New Issue
Block a user