On 12/04/2017 07:46 AM, Dmitry Goncharov wrote:
Can't you simply copy nonnull entries in-place, in a single pass?
The first pass calls is_dir and frees and resets files. Do you mean to
also do copying in this very pass?
I would think that would be easy, yes.
That way, the filtered order will be the same as the original order.
The stable algorithm results in more iterations and more copying. Are you sure?
Sorry, I'm not seeing why an extra iteration would be needed. I expect
users would prefer that this bug-fix does not alter the order of
returned values.