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

Remove INVALID_BASE and use Option<NonZeroU32> for base #55

Merged
merged 6 commits into from
Jun 20, 2022

Conversation

vbkaisetsu
Copy link
Member

I am not sure if the following part is correct, could you check carefully?

// len() is not 0 since states has at least block_len items.
// The following value always larger than or equal to len() since block_len is
// alphabet_size().next_power_of_two().
NonZeroU32::new(u32::try_from(self.states.len()).unwrap() ^ edges[0].0).unwrap()

@vbkaisetsu vbkaisetsu marked this pull request as ready for review June 18, 2022 05:17
src/builder.rs Outdated Show resolved Hide resolved
src/charwise/builder.rs Outdated Show resolved Hide resolved
src/charwise.rs Show resolved Hide resolved
src/lib.rs Show resolved Hide resolved
@kampersanda
Copy link
Member

And, the following part is correct. Thank you for your modification.

// len() is not 0 since states has at least block_len items.
// The following value always larger than or equal to len() since block_len is
// alphabet_size().next_power_of_two().
NonZeroU32::new(u32::try_from(self.states.len()).unwrap() ^ edges[0].0).unwrap()

@vbkaisetsu vbkaisetsu enabled auto-merge (squash) June 19, 2022 13:14
@vbkaisetsu vbkaisetsu disabled auto-merge June 20, 2022 00:48
@vbkaisetsu vbkaisetsu enabled auto-merge (squash) June 20, 2022 00:48
@vbkaisetsu vbkaisetsu merged commit d854e61 into main Jun 20, 2022
@vbkaisetsu vbkaisetsu deleted the remove-invalid-base branch June 20, 2022 00:49
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

3 participants