On Wed, 15 Mar 2023 15:10:49 GMT, Eirik Bjorsnos <d...@openjdk.org> wrote:
>> We can do `Integer.compareUnsigned(ch, 0xFF) <= 0` > > We could, but benchmarks show no performance improvements over the current > PR. I think the current code is perhaps slightly more readable. Does non-short-circuit logical AND operator perform similar to baseline? In this very specific case there is no risk of side effects due to method calls, no risk of null pointer exception because of primitives, and there is not an excessive amount of conditions. Therefore, I would think either `&` or `&&` are viable options. `if (ch >= 0 & ch <= 0xFF) {` I ask just for the sake of my own learning on this topic as it relates to performance as opposed to code readability preferences. ------------- PR: https://git.openjdk.org/jdk/pull/13040