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

Use compare instead of signum #347

Merged
merged 1 commit into from
Sep 27, 2024
Merged

Use compare instead of signum #347

merged 1 commit into from
Sep 27, 2024

Conversation

dmlloyd
Copy link
Collaborator

@dmlloyd dmlloyd commented Sep 27, 2024

This will give the same result, however there are certain cases where using signum for comparisons fails, so it is best to stick with Integer.compare even if it is not a specific problem in this case.

While we're in here, we can also use Byte.toUnsignedInt for further code clarity in these cases.

This will give the same result, however there are certain cases where using `signum` for comparisons fails, so it is best to stick with `Integer.compare` even if it is not a specific problem in this case.

While we're in here, we can also use `Byte.toUnsignedInt` for further code clarity in these cases.
@dmlloyd dmlloyd merged commit dbb8aa3 into smallrye:main Sep 27, 2024
4 checks passed
@dmlloyd dmlloyd deleted the signum branch September 27, 2024 15:47
@github-actions github-actions bot added this to the 2.7.0 milestone Sep 27, 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.

2 participants