Remove unnecessary condition in AssertOffsetAndLength.

Condition is already checked and covered in the following condition, the second one was excess.

Signed-off-by: Wojciech Jaszczak <jaszczakw@gmail.com>
This commit is contained in:
Wojciech Jaszczak
2016-04-08 19:56:02 +02:00
parent f4a5c9de50
commit c837d29eab

View File

@@ -129,8 +129,7 @@ namespace FlatBuffers
private void AssertOffsetAndLength(int offset, int length) private void AssertOffsetAndLength(int offset, int length)
{ {
if (offset < 0 || if (offset < 0 ||
offset >= _buffer.Length || offset > _buffer.Length - length)
offset + length > _buffer.Length)
throw new ArgumentOutOfRangeException(); throw new ArgumentOutOfRangeException();
} }