mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Modernize std::count
with ranges
This commit is contained in:
@ -143,7 +143,7 @@ enum class FileLookupMode
|
||||
static SystemTimers::TimeBaseTick EstimateFileLookupTicks(const std::string& path,
|
||||
FileLookupMode mode)
|
||||
{
|
||||
const size_t number_of_path_components = std::count(path.cbegin(), path.cend(), '/');
|
||||
const size_t number_of_path_components = std::ranges::count(path, '/');
|
||||
if (number_of_path_components == 0)
|
||||
return 0_tbticks;
|
||||
|
||||
|
@ -467,7 +467,7 @@ ResultCode HostFileSystem::CreateFileOrDirectory(Uid uid, Gid gid, const std::st
|
||||
return ResultCode::Invalid;
|
||||
}
|
||||
|
||||
if (!is_file && std::count(path.begin(), path.end(), '/') > int(MaxPathDepth))
|
||||
if (!is_file && std::ranges::count(path, '/') > int(MaxPathDepth))
|
||||
return ResultCode::TooManyPathComponents;
|
||||
|
||||
const auto split_path = SplitPathAndBasename(path);
|
||||
|
Reference in New Issue
Block a user