-
Notifications
You must be signed in to change notification settings - Fork 174
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
Add ZeroAsciiIgnoreCaseTrieCursor #4563
Conversation
c: u8, | ||
) -> Option<u8> { | ||
// BinarySpans is tricky to implement because the state can no longer be simply a trie | ||
debug_assert!( |
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.
Should this return None
here without assertions?
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.
Without assertions it returns None on line 468, if it actually hits a span node.
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.
There's already a debug assert there, why this as well? There should at least be a comment linking to the line and what the gigo value is.
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.
I expanded these comments
/// For examples, see [`ZeroAsciiIgnoreCaseTrie::cursor()`]. | ||
// Clone but not Copy: <https://stackoverflow.com/q/32324251/1407170> | ||
#[derive(Debug, Clone)] | ||
pub struct ZeroAsciiIgnoreCaseTrieCursor<'a> { |
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.
not a big fan of adding yet another type, but you already know that
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.
I wrote some ideas on how to resolve this in #4561
Last piece of the ZeroTrie improvements required to continue work on #4548 / #4031
I filed #4561 for additional follow-up work to try to reduce code duplication. I would like to not block this PR on code duplication concerns.