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

@ -48,12 +48,11 @@ void AssetLoaderFontIcon::PreprocessRow(std::vector<std::string>& row)
bool AssetLoaderFontIcon::RowIsEmpty(const std::vector<std::string>& row)
{
return std::all_of(row.begin(),
row.end(),
[](const std::string& cell)
{
return cell.empty();
});
return std::ranges::all_of(row,
[](const std::string& cell)
{
return cell.empty();
});
}
bool AssetLoaderFontIcon::ParseInt(int& value, const std::string& str)

View File

@ -27,7 +27,7 @@ namespace
{
std::string soundFilePath(sndAlias->assetFileName);
std::replace(soundFilePath.begin(), soundFilePath.end(), '\\', '/');
std::ranges::replace(soundFilePath, '\\', '/');
for (const auto& droppedPrefix : PREFIXES_TO_DROP)
{
if (soundFilePath.rfind(droppedPrefix, 0) != std::string::npos)