我刚刚在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);
}
Run Code Online (Sandbox Code Playgroud)
将int左移0的重点是什么?
在该类声明之前,有以下评论:
// -- This file was mechanically generated: Do not edit! -- //
Run Code Online (Sandbox Code Playgroud)
使用的代码生成方案可能没有费心去除0,即使它们没有效果.
| 归档时间: |
|
| 查看次数: |
70 次 |
| 最近记录: |