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

Some optimizations for union formation #521

Merged
merged 1 commit into from
Apr 13, 2022
Merged

Some optimizations for union formation #521

merged 1 commit into from
Apr 13, 2022

Conversation

JelleZijlstra
Copy link
Contributor

No description provided.

try:
# Don't readd it to preserve original ordering.
if subval not in hashable_vals:
hashable_vals[subval] = None
except Exception:
unhashable_vals.append(subval)
existing = list(hashable_vals) + unhashable_vals
num = len(existing)
reachabilities = [_is_unreachable(val) for val in existing]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This defers the _is_unreachable call until after we have deduplicated the values, so we don't call it repeatedly if we have lots of duplicates.

@JelleZijlstra JelleZijlstra merged commit 0f995f4 into master Apr 13, 2022
@JelleZijlstra JelleZijlstra deleted the optimize branch April 13, 2022 18:45
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

1 participant