smallrye / smallrye-common

Common utilities for SmallRye
Apache License 2.0
21 stars 24 forks source link

Use `compare` instead of `signum` #347

Closed dmlloyd closed 2 weeks ago

dmlloyd commented 2 weeks ago

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.