Merge pull request #30726 from GodotExplorer/revert-30657-optimize_dir_access_unix_get_next

Revert "Optimize DirAccessUnix::get_next() for some file systems"
This commit is contained in:
Rémi Verschelde 2019-07-22 11:59:09 +02:00 committed by GitHub
commit 4b1ec08bc3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -136,31 +136,27 @@ String DirAccessUnix::get_next() {
return "";
}
//typedef struct stat Stat;
struct stat flags;
String fname = fix_unicode_name(entry->d_name);
if (entry->d_type == DT_UNKNOWN) {
//typedef struct stat Stat;
struct stat flags;
String f = current_dir.plus_file(fname);
String f = current_dir.plus_file(fname);
if (stat(f.utf8().get_data(), &flags) == 0) {
if (stat(f.utf8().get_data(), &flags) == 0) {
if (S_ISDIR(flags.st_mode)) {
if (S_ISDIR(flags.st_mode)) {
_cisdir = true;
} else {
_cisdir = false;
}
_cisdir = true;
} else {
_cisdir = false;
}
} else {
_cisdir = (entry->d_type == DT_DIR);
_cisdir = false;
}
_cishidden = (fname != "." && fname != ".." && fname.begins_with("."));