What is the effect of shifting an integer zero?

I just noticed this in DirectByteBuffer.slice () :

public ByteBuffer slice() {
    int pos = this.position();
    int lim = this.limit();
    assert (pos <= lim);
    int rem = (pos <= lim ? lim - pos : 0);
    int off = (pos << 0); // <---- what does this do
    assert (off >= 0);
    return new DirectByteBuffer(this, -1, 0, rem, rem, off);
}

      

what is the shift point of the int from the left by 0?

+3


source to share


1 answer


Before this class declaration, there is the following comment:

// -- This file was mechanically generated: Do not edit! -- //

      



The code generation scheme used probably didn't get in the way of getting rid of the 0 shifts, although they have no effect.

+5


source







All Articles