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

Fix mergeOverlappingSets implementation #321

Merged
merged 2 commits into from
Sep 6, 2021
Merged

Conversation

RunDevelopment
Copy link
Collaborator

This fixes a bug in mergeOverlappingSets. The function returned more elements than it was supposed to.

I took this chance and reimplemented the function using a simpler and a lot more efficient approach.

Further, I changed the function's interface to take and return arrays instead of sets. This make a lot of copying and array-to-set conversions unnecessary.


This is a branch of #320 because the new test case only reproduces the bug I fixed with the new and improved getLongestPrefix.

@RunDevelopment RunDevelopment added the bug Something isn't working label Sep 5, 2021
Copy link
Owner

@ota-meshi ota-meshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ota-meshi ota-meshi merged commit 750abbc into master Sep 6, 2021
@ota-meshi ota-meshi deleted the mergeOverlappingSets-fix branch September 6, 2021 06:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants