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:
1 parent
9f972db4b8
commit
8b9f92a0af
9 files changed
+26
-38
No files matched your search
@@ -1053,8 +1053,7 @@ void VolumeVerifier::SetUpHashing()
|
||||
m_scrubber.SetupScrub(m_volume);
|
||||
}
|
||||
|
||||
std::sort(m_groups.begin(), m_groups.end(),
|
||||
[](const GroupToVerify& a, const GroupToVerify& b) { return a.offset < b.offset; });
|
||||
std::ranges::sort(m_groups, {}, &GroupToVerify::offset);
|
||||
|
||||
if (m_hashes_to_calculate.crc32)
|
||||
m_crc32_context = Common::StartCRC32();
|
||||
|
||||
Reference in new issue
Block a user