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

Make DecodeEstimate never panic #216

Closed
wants to merge 1 commit into from
Closed

Conversation

Nugine
Copy link

@Nugine Nugine commented Jan 12, 2023

The calculations in GeneralPurposeEstimate::new can be transformed to another formula which never panics. The performance should be the same after optimization.

Do I need to adjust corresponding documentation?

@marshallpierce
Copy link
Owner

marshallpierce commented Jan 17, 2023

Thanks! Even though surely nobody would ever hit the usize::MAX - 3 limit, it's nice to simply have the panic be impossible. I ended up coming up with a formula that produces slightly tighter assembly: #217

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