use std chr functions
The ones in std have overloads for const char/char. Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:

committed by
Max Kellermann

parent
99afe8e6d1
commit
e4dad42ca1
@@ -55,7 +55,7 @@ void
|
||||
UpdateWalk::UpdateArchiveTree(ArchiveFile &archive, Directory &directory,
|
||||
const char *name) noexcept
|
||||
{
|
||||
const char *tmp = strchr(name, '/');
|
||||
const char *tmp = std::strchr(name, '/');
|
||||
if (tmp) {
|
||||
const std::string_view child_name(name, tmp - name);
|
||||
//add dir is not there already
|
||||
|
@@ -148,7 +148,7 @@ WatchDirectory::GetUriFS() const noexcept
|
||||
static bool skip_path(const char *path)
|
||||
{
|
||||
return PathTraitsFS::IsSpecialFilename(path) ||
|
||||
strchr(path, '\n') != nullptr;
|
||||
std::strchr(path, '\n') != nullptr;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -191,7 +191,7 @@ UpdateWalk::UpdateDirectoryChild(Directory &directory,
|
||||
const ExcludeList &exclude_list,
|
||||
const char *name, const StorageFileInfo &info) noexcept
|
||||
try {
|
||||
assert(strchr(name, '/') == nullptr);
|
||||
assert(std::strchr(name, '/') == nullptr);
|
||||
|
||||
if (info.IsRegular()) {
|
||||
UpdateRegularFile(directory, name, info);
|
||||
@@ -223,7 +223,7 @@ gcc_pure
|
||||
static bool
|
||||
skip_path(const char *name_utf8) noexcept
|
||||
{
|
||||
return strchr(name_utf8, '\n') != nullptr;
|
||||
return std::strchr(name_utf8, '\n') != nullptr;
|
||||
}
|
||||
|
||||
gcc_pure
|
||||
|
Reference in New Issue
Block a user