Optimize dir reading on Unix.

This commit is contained in:
Themaister 2012-06-18 23:27:49 +02:00
parent f81c9c3166
commit e252ab8f61

View File

@ -265,12 +265,13 @@ char **dir_list_new(const char *dir, const char *ext, bool include_dirs)
{
const char *name = entry->d_name;
const char *file_ext = path_get_extension(name);
bool is_dir = entry->d_type == DT_DIR;
if (!include_dirs && path_is_directory(name))
if (!include_dirs && is_dir)
continue;
#ifndef __CELLOS_LV2__
if (!path_is_directory(name) && ext_list && !string_list_find_elem(ext_list, file_ext))
if (!is_dir && ext_list && !string_list_find_elem(ext_list, file_ext))
continue;
#endif