-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Description
When I saw the new readdirex() function I jumped for joy. Now instead of glob()-bing a dir and looping over the result and calling getf*() etc. on each member, I can save time and just use readdirex().
However, the savings that readdirex() offers are often completely canceled out by the fact that readdirex() sorts its results case-sensitively while glob() on macOS sorts its results case-insensitively. Since I want case-insensitivity, I have to then call sort() on the results of readdirex() and use a custom sorting function (since readdirex() provides a list of dicts and not a list of filenames). The overhead this adds eats up nearly all the savings that readdirex() brought, and indeed sometimes is a net loss depending on the filenames in the dir and how many filenames there are. (I've looked at it with :profile.)
Can readdirex() be made to take an optional argument, which if present causes readdirex() to sort case-insensitively?