Fixing condition for taking array from the pool
This commit is contained in:
1 parent
3ce5c52d54
commit
315acb5a68
1 file changed
+1
-1
@@ -84,7 +84,7 @@ namespace Recyclable.Collections
|
|||||||
int requiredBlockCount = (int)(newCapacity / blockSize) + (newCapacity % blockSize > 0 ? 1 : 0);
|
int requiredBlockCount = (int)(newCapacity / blockSize) + (newCapacity % blockSize > 0 ? 1 : 0);
|
||||||
|
|
||||||
Span<T[]> newArraySpan;
|
Span<T[]> newArraySpan;
|
||||||
T[][] newMemoryBlocks = requiredBlockCount > RecyclableDefaults.MinPooledArrayLength
|
T[][] newMemoryBlocks = requiredBlockCount >= RecyclableDefaults.MinPooledArrayLength
|
||||||
? arrayPool.Rent(requiredBlockCount)
|
? arrayPool.Rent(requiredBlockCount)
|
||||||
: new T[requiredBlockCount][];
|
: new T[requiredBlockCount][];
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user