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

Replace bigint casting with bigint literal #3624

Merged
merged 3 commits into from
Mar 9, 2023
Merged

Replace bigint casting with bigint literal #3624

merged 3 commits into from
Mar 9, 2023

Conversation

NullSoldier
Copy link
Contributor

@NullSoldier NullSoldier commented Mar 8, 2023

Summary

There's no reason to wrap bigints in the bigint type. You can just use literals. This only replaces some places.

Testing Plan

Breaking Change

Is this a breaking change? If yes, add notes below on why this is breaking and
what additional work is required, if any.

[ ] Yes

@NullSoldier NullSoldier requested a review from a team as a code owner March 8, 2023 04:16
const MAX_256_BIT_NUM = BigInt(
'115792089237316195423570985008687907853269984665640564039457584007913129639935',
)
const MAX_256_BIT_NUM =
Copy link
Member

Choose a reason for hiding this comment

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

Here do you want to do this for readability?

const MAX_256_BIT_NUM = 2n ** 256n - 1n

Copy link
Member

Choose a reason for hiding this comment

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

could do in another change too

Copy link
Member

Choose a reason for hiding this comment

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

I think that's clean, but I'd recommend doing it in another PR just to avoid the back-and-forth

dguenther and others added 2 commits March 9, 2023 09:15
Co-authored-by: Hugh Cunningham <57735705+hughy@users.noreply.github.com>
@dguenther dguenther merged commit 73b0abe into staging Mar 9, 2023
@dguenther dguenther deleted the jason/bigint branch March 9, 2023 23:27
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

4 participants