mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-29 11:01:57 +00:00
Update comment in utils.cc
This commit is contained in:
parent
93d3b2b3cb
commit
f698a3451f
15
src/utils.cc
15
src/utils.cc
@ -14,7 +14,6 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
|
|
||||||
#if !defined(__APPLE__)
|
#if !defined(__APPLE__)
|
||||||
#include <sparsepp/spp_memory.h>
|
#include <sparsepp/spp_memory.h>
|
||||||
#endif
|
#endif
|
||||||
@ -58,9 +57,10 @@ bool AnyStartsWith(const std::vector<std::string>& values,
|
|||||||
|
|
||||||
bool StartsWithAny(const std::string& value,
|
bool StartsWithAny(const std::string& value,
|
||||||
const std::vector<std::string>& startings) {
|
const std::vector<std::string>& startings) {
|
||||||
return std::any_of(
|
return std::any_of(std::begin(startings), std::end(startings),
|
||||||
std::begin(startings), std::end(startings),
|
[&value](const std::string& starting) {
|
||||||
[&value](const std::string& starting) { return StartsWith(value, starting); });
|
return StartsWith(value, starting);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EndsWithAny(const std::string& value,
|
bool EndsWithAny(const std::string& value,
|
||||||
@ -138,9 +138,12 @@ static void GetFilesInFolderHelper(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Skip all dot files.
|
// 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.
|
// 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.name[0] != '.') {
|
||||||
if (file.is_dir) {
|
if (file.is_dir) {
|
||||||
if (recursive) {
|
if (recursive) {
|
||||||
|
Loading…
Reference in New Issue
Block a user