Fix to use the new _blockSize when we add capacity

This commit is contained in:
mlemanczyk committed 2023-01-31 20:23:28 +01:00
1 parent 55dc1459c7
commit 2dc6d74b0b
1 file changed
+3
+3
View File
@@ -405,6 +405,9 @@ namespace Recyclable.Collections
if (capacity < requiredCapacity)
{
_ = EnsureCapacity(requiredCapacity);
blockSize = _blockSize;
targetBlockIdx = (targetItemIdx / blockSize) + (targetItemIdx > 0 ? 1 : 0);
targetItemIdx = (int)(oldLongCount % blockSize);
}
memoryBlocksSpan = new(_memoryBlocks);