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

Build union of two maps/sets by mutating the larger one, not the first #163

Merged
merged 1 commit into from Apr 29, 2022

Conversation

SimonSapin
Copy link
Contributor

fn union(self, other: Self) -> Self is implemented by progressively mutating then returning one of the two given collections, while consuming and iterating the other.

If one of the two collections is much larger, mutating that one can be faster and yield better reuse of internal nodes.

`fn union(self, other: Self) -> Self` is implemented by progressively
mutating then returning one of the two given collections,
while consuming and iterating the other.

If one of the two collections is much larger,
mutating that one can be faster and yield better reuse of internal nodes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants