Failing tests fixed. RecyclableLongList.Insert(int) fixed.
This commit is contained in:
1 parent
49bcc3801d
commit
8e2885ecd3
1 file changed
+8
-6
@@ -970,17 +970,19 @@ namespace Recyclable.Collections
|
|||||||
new Span<T>(_memoryBlocks[_nextItemBlockIndex])[_nextItemIndex] = item;
|
new Span<T>(_memoryBlocks[_nextItemBlockIndex])[_nextItemIndex] = item;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_nextItemIndex < _blockSizeMinus1)
|
if (++_nextItemIndex == _blockSize)
|
||||||
{
|
{
|
||||||
if (++_nextItemIndex == 1)
|
if (_nextItemBlockIndex > _lastBlockWithData)
|
||||||
{
|
{
|
||||||
_lastBlockWithData++;
|
_lastBlockWithData++;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_nextItemIndex = 0;
|
|
||||||
_nextItemBlockIndex++;
|
_nextItemBlockIndex++;
|
||||||
|
_nextItemIndex = 0;
|
||||||
|
}
|
||||||
|
else if (_nextItemIndex == 1 && _nextItemBlockIndex > _lastBlockWithData)
|
||||||
|
{
|
||||||
|
_lastBlockWithData++;
|
||||||
}
|
}
|
||||||
|
|
||||||
_version++;
|
_version++;
|
||||||
|
|||||||
Reference in new issue
Block a user