Skip to content

Conversation

@CosminPerRam
Copy link
Contributor

Reduces calls to CrcReader::sum (which clones 16 bytes).
Replaces manual shifting with rust-provided to_le_bytes.
Moved explicit reference from declaration to usage.

I think this would technically be a perf improvement, but there is no real world difference in it at all (godbolt here).

Copy link
Member

@Byron Byron left a comment

Choose a reason for hiding this comment

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

Thanks a lot!

It's interesting that the optimizer seems to do all that anywhere so this change doesn't lead to any differences after all, despite of course, being easier to read, a big win in my book.

@Byron Byron merged commit 5c6eaec into rust-lang:main Feb 13, 2025
14 checks passed
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