From c837d29eabd8b844a10e20f102f3de4d5a05ad60 Mon Sep 17 00:00:00 2001 From: Wojciech Jaszczak Date: Fri, 8 Apr 2016 19:56:02 +0200 Subject: [PATCH] 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 --- net/FlatBuffers/ByteBuffer.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/FlatBuffers/ByteBuffer.cs b/net/FlatBuffers/ByteBuffer.cs index 37779b593..7ca491dc5 100755 --- a/net/FlatBuffers/ByteBuffer.cs +++ b/net/FlatBuffers/ByteBuffer.cs @@ -129,8 +129,7 @@ namespace FlatBuffers private void AssertOffsetAndLength(int offset, int length) { if (offset < 0 || - offset >= _buffer.Length || - offset + length > _buffer.Length) + offset > _buffer.Length - length) throw new ArgumentOutOfRangeException(); }