mirror of https://github.com/ericonr/erm.git
Implement . and .. detection manually.
strcmp() startup cost is too high and not worth it here.
This commit is contained in:
parent
2fbe3a2789
commit
851bd62ab6
5
remove.c
5
remove.c
|
@ -155,7 +155,10 @@ static void *process_queue_item(void *arg)
|
|||
size_t plen = strlen(t.path);
|
||||
struct dirent *entry;
|
||||
while ((entry = readdir(d))) {
|
||||
if (strcmp(".", entry->d_name)==0 || strcmp("..", entry->d_name)==0) continue;
|
||||
if (entry->d_name[0] == '.' &&
|
||||
(entry->d_name[1] == '\0' ||
|
||||
(entry->d_name[1] == '.' && entry->d_name[2] == '\0')))
|
||||
continue;
|
||||
|
||||
/* fast path to avoid allocations */
|
||||
int trv;
|
||||
|
|
Loading…
Reference in New Issue