From f698a3451fcfc63424359e2b0db57421af288fc4 Mon Sep 17 00:00:00 2001 From: Jacob Dufault Date: Tue, 24 Oct 2017 18:28:23 -0700 Subject: [PATCH] Update comment in utils.cc --- src/utils.cc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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) {