RecyclableLongList.AddRangeWithKnownCount fixed for cases when both collections are empty.
This commit is contained in:
1 parent
e53d6a134c
commit
10189d0d11
1 file changed
+5
@@ -146,6 +146,11 @@ namespace Recyclable.Collections
|
||||
Span<T[]> memoryBlocksSpan;
|
||||
Span<T> blockArraySpan;
|
||||
long requiredCapacity = copied + requiredAdditionalCapacity;
|
||||
if (requiredCapacity == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_capacity < requiredCapacity)
|
||||
{
|
||||
_capacity = Helpers.Resize(this, _blockSize, _blockSizePow2BitShift, checked((long)BitOperations.RoundUpToPowerOf2((ulong)requiredCapacity)));
|
||||
|
||||
Reference in new issue
Block a user