Remove duplicate range check in AbstractByteBuf.skipBytes()

This commit is contained in:
Trustin Lee 2014-07-29 15:57:58 -07:00
parent 1c9cb90655
commit e6193fe0ef

View File

@ -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;
}