Checked length
This commit is contained in:
parent
0f389f01cb
commit
80dc284407
|
|
@ -513,21 +513,24 @@ namespace Microsoft.AspNet.Server.Kestrel.Infrastructure
|
||||||
var block = _block;
|
var block = _block;
|
||||||
var index = _index;
|
var index = _index;
|
||||||
var length = 0;
|
var length = 0;
|
||||||
while (true)
|
checked
|
||||||
{
|
{
|
||||||
if (block == end._block)
|
while (true)
|
||||||
{
|
{
|
||||||
return length + end._index - index;
|
if (block == end._block)
|
||||||
}
|
{
|
||||||
else if (block.Next == null)
|
return length + end._index - index;
|
||||||
{
|
}
|
||||||
throw new InvalidOperationException("end did not follow iterator");
|
else if (block.Next == null)
|
||||||
}
|
{
|
||||||
else
|
throw new InvalidOperationException("end did not follow iterator");
|
||||||
{
|
}
|
||||||
length += block.End - index;
|
else
|
||||||
block = block.Next;
|
{
|
||||||
index = block.Start;
|
length += block.End - index;
|
||||||
|
block = block.Next;
|
||||||
|
index = block.Start;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue