Commit 8b18e487 authored by Wouter van Oortmerssen's avatar Wouter van Oortmerssen

Merge pull request #3839 from klapek/net/bytebuffer-assert-optimization

Remove unnecessary condition in AssertOffsetAndLength.
parents ec1daef8 c837d29e
...@@ -129,8 +129,7 @@ namespace FlatBuffers ...@@ -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();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment