-
Notifications
You must be signed in to change notification settings - Fork 355
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
Signed int keys order #582
Conversation
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.
Good to see that this idea actually worked just fine.
7bbaed9
to
a993938
Compare
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.
looks good.
I would clean up the test cases to be more explicit rather than just contain the same math being tested
also, let's add test case that -321.to_cw_bytes()
< 0.to_cw_bytes()
< 652.to_cw_bytes()
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.
lgtm
Personally I'd replace couple big numbers with constants for better transparency, but overall it's fine.
Closes #489.
There are a number of different ways to do the signed int key modification (a number of different impls in the commits). Not sure what is the best one; opted for doing it without mutable slices, and without branching.
I guess the only way to know for sure would be by benchmarking them. Will create an issue for it, and we can do in the future.