Hi Jeff, I did wonder about that when i saw that code too. Without looking at generated machine code i do not know.
Paul. On 21 Sep 2015, at 20:12, Jeff Hain <jeffh...@rocketmail.com> wrote: > > Hi. > > > > In your webrev: > > + if ((length | fromIndex | size) < 0 || size > length - fromIndex) > + throw outOfBounds(fromIndex, size, length, oobe); > > > > In Buffer.java (equivalent if adding "| size"): > static void checkBounds(int off, int len, int size) { // package-private > if ((off | len | (off + len) | (size - (off + len))) < 0) > throw new IndexOutOfBoundsException(); > } > > > > Maybe the second way (only one boolean check) is better for perfs? > > > > -Jeff >