Tiny cleanup
This commit is contained in:
1 parent
de3f06421f
commit
853a69fa4d
1 file changed
+19
-19
@@ -350,26 +350,26 @@ namespace Recyclable.Collections
|
|||||||
if (enumerator.MoveNext())
|
if (enumerator.MoveNext())
|
||||||
{
|
{
|
||||||
int available = capacity - targetItemIdx;
|
int available = capacity - targetItemIdx;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if (targetItemIdx + growByCount > capacity)
|
if (targetItemIdx + growByCount > capacity)
|
||||||
{
|
{
|
||||||
capacity = EnsureCapacity(this, capacity + growByCount);
|
capacity = EnsureCapacity(this, capacity + growByCount);
|
||||||
memorySpan = new(_memoryBlock);
|
memorySpan = new(_memoryBlock);
|
||||||
available = capacity - targetItemIdx;
|
available = capacity - targetItemIdx;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < available; i++)
|
for (i = 0; i < available; i++)
|
||||||
{
|
{
|
||||||
memorySpan[targetItemIdx++] = enumerator.Current;
|
memorySpan[targetItemIdx++] = enumerator.Current;
|
||||||
if (!enumerator.MoveNext())
|
if (!enumerator.MoveNext())
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (i >= available);
|
while (i >= available);
|
||||||
}
|
}
|
||||||
|
|
||||||
_count = targetItemIdx;
|
_count = targetItemIdx;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user