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

Use chunks instead of chunks_exact #379

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

jqnatividad
Copy link
Contributor

The chunks_exact method returns chunks of exactly 4 bytes, and any leftover bytes at the end of the slice are ignored.

Since we know that the input slice will always be a multiple of 4 bytes per the assert, we can use the chunks method instead, which is slightly faster because it doesn't need to redundantly check for leftover bytes.

The `chunks_exact` method returns chunks of exactly 4 bytes, and any leftover bytes at the end of the slice are ignored.

Since we know that the input slice will always be a multiple of 4 bytes per the assert, we can use the `chunks` method instead, which is slightly faster because it doesn't need to redundantly check for leftover bytes.
@tafia tafia merged commit 1f95e96 into tafia:master Dec 12, 2023
3 of 4 checks passed
@tafia
Copy link
Owner

tafia commented Dec 12, 2023

Thanks!

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.

2 participants