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

Remove unnecessary unsafe #1207

Closed
wants to merge 1 commit into from
Closed

Conversation

djmitche
Copy link

As suggested by @anforowicz in [1], this new_unchecked is unnecessary, as the value can be trivially determined to be nonzero.

See compiler explorer to validate that this is correctly optimized (with -O).

[1] https://chromium-review.googlesource.com/c/chromium/src/+/6099062?tab=comments

cc: @mzabaluev per 5ae30c5

As suggested by @anforowicz in [1], this `new_unchecked` is unnecessary,
as the value can be trivially determined to be nonzero.

[1] https://chromium-review.googlesource.com/c/chromium/src/+/6099062?tab=comments
@djmitche
Copy link
Author

Ah, it's const :)

@djmitche djmitche closed this Dec 17, 2024
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

1 participant