1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Using iterator pattern instead of List::Element *.

Co-authored-by: Adam Scott <ascott.ca@gmail.com>
This commit is contained in:
Yyf2333
2025-02-03 14:16:27 +08:00
committed by Yufeng Ying
parent 594d64ec24
commit 22b5ec17fb
36 changed files with 150 additions and 173 deletions

View File

@@ -1151,15 +1151,15 @@ int EditorFileSystem::_scan_new_dir(ScannedDirectory *p_dir, Ref<DirAccess> &da)
int nb_files_total_scan = 0;
for (List<String>::Element *E = dirs.front(); E; E = E->next()) {
if (da->change_dir(E->get()) == OK) {
for (const String &dir : dirs) {
if (da->change_dir(dir) == OK) {
String d = da->get_current_dir();
if (d == cd || !d.begins_with(cd)) {
da->change_dir(cd); //avoid recursion
} else {
ScannedDirectory *sd = memnew(ScannedDirectory);
sd->name = E->get();
sd->name = dir;
sd->full_path = p_dir->full_path.path_join(sd->name);
nb_files_total_scan += _scan_new_dir(sd, da);
@@ -1169,7 +1169,7 @@ int EditorFileSystem::_scan_new_dir(ScannedDirectory *p_dir, Ref<DirAccess> &da)
da->change_dir("..");
}
} else {
ERR_PRINT("Cannot go into subdir '" + E->get() + "'.");
ERR_PRINT("Cannot go into subdir '" + dir + "'.");
}
}