Remove duplicate range check in AbstractByteBuf.skipBytes()
This commit is contained in:
parent
1c9cb90655
commit
e6193fe0ef
@ -711,14 +711,7 @@ public abstract class AbstractByteBuf extends ByteBuf {
|
||||
@Override
|
||||
public ByteBuf skipBytes(int length) {
|
||||
checkReadableBytes(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;
|
||||
readerIndex += length;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user