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

Switch to non-overflowing decoded length formula #217

Merged
merged 3 commits into from Feb 5, 2023

Conversation

marshallpierce
Copy link
Owner

@marshallpierce marshallpierce commented Jan 17, 2023

No change to benchmarks.

Motivated by the alternate approach in #216.

tests/encode.rs Outdated
Comment on lines 27 to 32
let mut bytes = Vec::<u8>::with_capacity(256);

for i in 0..255 {
for i in 0..=255 {
bytes.push(i);
}
bytes.push(255); //bug with "overflowing" ranges?
Copy link
Contributor

Choose a reason for hiding this comment

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

let bytes: Vec<u8> = (0..=255).collect();

Copy link
Owner Author

Choose a reason for hiding this comment

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

Heh, good point!

@marshallpierce marshallpierce merged commit 29ed4d0 into master Feb 5, 2023
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