Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve performance: Remove topmost directory #7

Open
JustMyGithub opened this issue Jun 17, 2019 · 2 comments
Open

Improve performance: Remove topmost directory #7

JustMyGithub opened this issue Jun 17, 2019 · 2 comments

Comments

@JustMyGithub
Copy link

Why does RED remove folders from leave to root? Why not just remove the topmost empty directory?

@hxseven
Copy link
Owner

hxseven commented Jan 29, 2021

Hi, that is a really good point! That would be much more clever 😅
I think one problem with this is that RED only maintains a flat list of empty directories and doesn't know about parent/child relationships. I'm currently trying to understand my code from years ago, maybe I will find a way to make the process more clever.
PS: Sorry for the super late answer.

@JustMyGithub
Copy link
Author

Well, if you have a flat sorted list of pathes of empty folders you can do a prefix matching to find the topmost parent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants