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

Trie workaround: Avoid assertion failure for "higher" bits. #250

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

matthewhammer
Copy link
Contributor

The problematic use case for this data structure is a poor hash function with many unequal keys whose hashes are all equal for some reason.

In these cases, the data structure design assumptions get violated, but there isn't a clear place to check for this given how things are structured. It's a lot of inductive, bottom-up logic.

This PR is helping move the problem, when it arises, from some low-level assertion failure into another part of the logic. To be clear, I do not think this PR is addressing the root issue of the design or its problematic behavior that we see in CanCan today. But it's helping push the problem into a new place, in other parts of the code.

@matthewhammer matthewhammer changed the base branch from master to next-moc April 27, 2021 20:31
@matthewhammer matthewhammer changed the base branch from next-moc to master April 27, 2021 20:34
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.

1 participant