[英]what is the effect of shifting an integer zero times?
我剛剛在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);
}
將int左移0的重點是什么?
在該類聲明之前,有以下評論:
// -- This file was mechanically generated: Do not edit! -- //
使用的代碼生成方案可能沒有費心去除0,即使它們沒有效果。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.