Optimize excluded items by avoiding allocations in function regex_check executed almost for every file(clock count of this function decreased from 6% to 3%)
Fixes problem when sometimes wildcards were not properly recognized
Big speedup when checking for big number of empty folders (btw - don't use BTreeMap<Pathbuf, X> when you are using a lot of .get() or .get_mut(), because comparison Pathbuf is very slow - sometimes better is to use HashMap<Pathbuf, X> and at the end converting it to BTreeMap)
Collecting files for scan can be a lot of faster due lazy file metadata gathering
Fix not selecting non accessible folder as non-empty
Before empty folders (~58s)
After(~4ms)