Remove duplicate range check in AbstractByteBuf.skipBytes()
This commit is contained in:
parent
73dfd7c01b
commit
07801d7b38
@ -739,14 +739,7 @@ public abstract class AbstractByteBuf extends ByteBuf {
|
|||||||
@Override
|
@Override
|
||||||
public ByteBuf skipBytes(int length) {
|
public ByteBuf skipBytes(int length) {
|
||||||
checkReadableBytes(length);
|
checkReadableBytes(length);
|
||||||
|
readerIndex += length;
|
||||||
int newReaderIndex = readerIndex + length;
|
|
||||||
if (newReaderIndex > writerIndex) {
|
|
||||||
throw new IndexOutOfBoundsException(String.format(
|
|
||||||
"length: %d (expected: readerIndex(%d) + length <= writerIndex(%d))",
|
|
||||||
length, readerIndex, writerIndex));
|
|
||||||
}
|
|
||||||
readerIndex = newReaderIndex;
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user