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())
|
||||
{
|
||||
int available = capacity - targetItemIdx;
|
||||
do
|
||||
{
|
||||
if (targetItemIdx + growByCount > capacity)
|
||||
{
|
||||
capacity = EnsureCapacity(this, capacity + growByCount);
|
||||
memorySpan = new(_memoryBlock);
|
||||
available = capacity - targetItemIdx;
|
||||
}
|
||||
do
|
||||
{
|
||||
if (targetItemIdx + growByCount > capacity)
|
||||
{
|
||||
capacity = EnsureCapacity(this, capacity + growByCount);
|
||||
memorySpan = new(_memoryBlock);
|
||||
available = capacity - targetItemIdx;
|
||||
}
|
||||
|
||||
for (i = 0; i < available; i++)
|
||||
{
|
||||
memorySpan[targetItemIdx++] = enumerator.Current;
|
||||
if (!enumerator.MoveNext())
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
while (i >= available);
|
||||
}
|
||||
for (i = 0; i < available; i++)
|
||||
{
|
||||
memorySpan[targetItemIdx++] = enumerator.Current;
|
||||
if (!enumerator.MoveNext())
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
while (i >= available);
|
||||
}
|
||||
|
||||
_count = targetItemIdx;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user