-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Remove redundant bit masking #5654
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 redundant bit masking #5654
Conversation
eamonnmcmanus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with the idea behind this PR. The existing code has a rather weird way of implementing the UTF-8 principle where the number of high 1 bits in the first byte indicates how many bytes there are. Your rewrite makes this clearer, since the masks are 0x3, 0x7, 0xF for 2, 3, or 4 bytes respectively.
db50046 to
d0bb0fe
Compare
|
@eamonnmcmanus added |
d0bb0fe to
8685091
Compare
8685091 to
b187f9d
Compare
|
@eamonnmcmanus changed to comments |
|
Thanks, this looks fine. Because of the way we sync between our internal repo and GitHub, we'll be closing this PR and sending out an equivalent one, duly attributed to you. |
|
Thanks for review |
Also add some more test cases for `hashString`. Closes #5654. RELNOTES=n/a PiperOrigin-RevId: 386122757
|
@eamonnmcmanus thanks for merging |
No description provided.