-
Notifications
You must be signed in to change notification settings - Fork 34
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
droplevels!(): more efficient implementation #359
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! If you want to make this even faster, you could skip some redundant checks that are done in levels!
(uniqueness and addition of new levels) but that could be avoided by using an unsafe internal function.
do you think it is ready to be merged? |
We might need to wait a bit as @nalimilan is OOO AFAICT. |
gentle bump |
Feel free to merge PRs that I have approved (three times!). :-) |
Replace the current one-line implementation of
droplevels!()
as behind the scenes it requires sorting and arrays intersection.The new implementation scans the array only once, and doesn't rebuild the array when all levels are observed.