Stop iterating twice over files and folders.