refactor: use std ranges functions where applicable

This commit is contained in:
Jan
2024-03-24 20:49:15 +01:00
parent 132cccb971
commit 239001e6f2
42 changed files with 251 additions and 295 deletions

View File

@ -82,7 +82,7 @@ std::vector<scr_string_t> AssetMarker::GetUsedScriptStrings() const
for (auto scrString : m_used_script_strings)
usedScriptStrings.push_back(scrString);
std::sort(usedScriptStrings.begin(), usedScriptStrings.end());
std::ranges::sort(usedScriptStrings);
}
return usedScriptStrings;

View File

@ -30,12 +30,11 @@ void ZoneLoader::AddXBlock(std::unique_ptr<XBlock> block)
{
m_blocks.push_back(block.get());
std::sort(m_blocks.begin(),
m_blocks.end(),
[](XBlock* b1, XBlock* b2) -> bool
{
return b1->m_index < b2->m_index;
});
std::ranges::sort(m_blocks,
[](XBlock* b1, XBlock* b2) -> bool
{
return b1->m_index < b2->m_index;
});
m_zone->GetMemory()->AddBlock(std::move(block));
}