From 315acb5a68b4cb1b4cf7a28dedcc73fb4cc0d4bf Mon Sep 17 00:00:00 2001 From: mlemanczyk Date: Sat, 28 Jan 2023 15:02:50 +0100 Subject: [PATCH] Fixing condition for taking array from the pool --- Recyclable.Collections/RecyclableList.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Recyclable.Collections/RecyclableList.cs b/Recyclable.Collections/RecyclableList.cs index 5e8cb31..af833bf 100644 --- a/Recyclable.Collections/RecyclableList.cs +++ b/Recyclable.Collections/RecyclableList.cs @@ -84,7 +84,7 @@ namespace Recyclable.Collections int requiredBlockCount = (int)(newCapacity / blockSize) + (newCapacity % blockSize > 0 ? 1 : 0); Span newArraySpan; - T[][] newMemoryBlocks = requiredBlockCount > RecyclableDefaults.MinPooledArrayLength + T[][] newMemoryBlocks = requiredBlockCount >= RecyclableDefaults.MinPooledArrayLength ? arrayPool.Rent(requiredBlockCount) : new T[requiredBlockCount][];