introduce LONE_CHAR (optimized strcmp with one-char string)

This commit is contained in:
Denis Vlasenko
2006-12-21 13:23:14 +00:00
parent 6910741067
commit bf66fbc8e2
17 changed files with 49 additions and 35 deletions

View File

@ -1079,7 +1079,7 @@ static char **get_dir(char *path)
dp = warn_opendir(path);
while ((ep = readdir(dp))) {
if ((!strcmp(ep->d_name, "..")) || (!strcmp(ep->d_name, ".")))
if (!strcmp(ep->d_name, "..") || LONE_CHAR(ep->d_name, '.'))
continue;
add_to_dirlist(ep->d_name, NULL, NULL, 0);
}