diff --git a/src/utils.cc b/src/utils.cc index 5fca8b15..f244be53 100644 --- a/src/utils.cc +++ b/src/utils.cc @@ -14,7 +14,6 @@ #include #include - #if !defined(__APPLE__) #include #endif @@ -58,9 +57,10 @@ bool AnyStartsWith(const std::vector& values, bool StartsWithAny(const std::string& value, const std::vector& startings) { - return std::any_of( - std::begin(startings), std::end(startings), - [&value](const std::string& starting) { return StartsWith(value, starting); }); + return std::any_of(std::begin(startings), std::end(startings), + [&value](const std::string& starting) { + return StartsWith(value, starting); + }); } bool EndsWithAny(const std::string& value, @@ -138,9 +138,12 @@ static void GetFilesInFolderHelper( } // Skip all dot files. - // We must always ignore the '.' and '..' directories, otherwise - // this will loop infinitely. + // // The nested ifs are intentional, branching order is subtle here. + // + // Note that in the future if we do support dot directories/files, we must + // always ignore the '.' and '..' directories otherwise this will loop + // infinitely. if (file.name[0] != '.') { if (file.is_dir) { if (recursive) {