diff options
| author | mitaclaw <140017135+mitaclaw@users.noreply.github.com> | 2024-09-29 11:19:33 -0700 |
|---|---|---|
| committer | mitaclaw <140017135+mitaclaw@users.noreply.github.com> | 2025-03-09 13:26:38 -0700 |
| commit | 8b9f92a0af0f467ffa0bde5f4e6239e57fbd4b5e (patch) | |
| tree | 094c6bc6d9007cbf96cdaac54dbdc3cc8e24e320 /Source/Core/Common/FatFsUtil.cpp | |
| parent | 9f972db4b8e730751d643680ec90f177c3010333 (diff) | |
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.
Diffstat (limited to 'Source/Core/Common/FatFsUtil.cpp')
| -rw-r--r-- | Source/Core/Common/FatFsUtil.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Source/Core/Common/FatFsUtil.cpp b/Source/Core/Common/FatFsUtil.cpp index 3ad4fd9fb3..1423bd4815 100644 --- a/Source/Core/Common/FatFsUtil.cpp +++ b/Source/Core/Common/FatFsUtil.cpp @@ -485,10 +485,7 @@ static bool Pack(const std::function<bool()>& cancelled, const File::FSTEntry& e static void SortFST(File::FSTEntry* root) { - std::sort(root->children.begin(), root->children.end(), - [](const File::FSTEntry& lhs, const File::FSTEntry& rhs) { - return lhs.virtualName < rhs.virtualName; - }); + std::ranges::sort(root->children, {}, &File::FSTEntry::virtualName); for (auto& child : root->children) SortFST(&child); } |
