mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-09-21 00:38:43 +00:00
Modernize std::count
with ranges
This commit is contained in:
parent
ed5eb49d47
commit
c46060e298
3 changed files with 3 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue