Tiny cleanup. Declaration moved closer to usage.
This commit is contained in:
1 parent
96f4912cd3
commit
a9012dc25d
1 file changed
+1
-1
@@ -79,7 +79,6 @@ namespace Recyclable.Collections
|
|||||||
protected static T[][] SetNewLength(in T[][]? source, int blockSize, in long newCapacity)
|
protected static T[][] SetNewLength(in T[][]? source, int blockSize, in long newCapacity)
|
||||||
{
|
{
|
||||||
ArrayPool<T[]> arrayPool = _arrayPool;
|
ArrayPool<T[]> arrayPool = _arrayPool;
|
||||||
ArrayPool<T> blockArrayPool = _blockArrayPool;
|
|
||||||
var sourceBlockCount = source?.Length ?? 0;
|
var sourceBlockCount = source?.Length ?? 0;
|
||||||
int requiredBlockCount = (int)(newCapacity / blockSize) + (newCapacity % blockSize > 0 ? 1 : 0);
|
int requiredBlockCount = (int)(newCapacity / blockSize) + (newCapacity % blockSize > 0 ? 1 : 0);
|
||||||
|
|
||||||
@@ -100,6 +99,7 @@ namespace Recyclable.Collections
|
|||||||
newArraySpan = newArraySpan[sourceBlockCount..];
|
newArraySpan = newArraySpan[sourceBlockCount..];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ArrayPool<T> blockArrayPool = _blockArrayPool;
|
||||||
int uninitializedBlocksCount = newArraySpan.Length;
|
int uninitializedBlocksCount = newArraySpan.Length;
|
||||||
if (uninitializedBlocksCount == requiredBlockCount)
|
if (uninitializedBlocksCount == requiredBlockCount)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user