Fix to use the new _blockSize when we add capacity
This commit is contained in:
1 parent
55dc1459c7
commit
2dc6d74b0b
1 file changed
+3
@@ -405,6 +405,9 @@ namespace Recyclable.Collections
|
|||||||
if (capacity < requiredCapacity)
|
if (capacity < requiredCapacity)
|
||||||
{
|
{
|
||||||
_ = EnsureCapacity(requiredCapacity);
|
_ = EnsureCapacity(requiredCapacity);
|
||||||
|
blockSize = _blockSize;
|
||||||
|
targetBlockIdx = (targetItemIdx / blockSize) + (targetItemIdx > 0 ? 1 : 0);
|
||||||
|
targetItemIdx = (int)(oldLongCount % blockSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
memoryBlocksSpan = new(_memoryBlocks);
|
memoryBlocksSpan = new(_memoryBlocks);
|
||||||
|
|||||||
Reference in new issue
Block a user