Performance improvement. Removing unnecessary var.

This commit is contained in:
mlemanczyk committed 2023-01-27 23:48:56 +01:00
1 parent d4440134c8
commit b9b4c40cf9
1 file changed
+3 -5
+3 -5
View File
@@ -199,15 +199,13 @@ namespace Recyclable.Collections
break; break;
} }
int blockSize = _blockSize; memory = SetNewLength(memory, _blockSize, newCapacity);
memory = SetNewLength(memory, blockSize, newCapacity);
if (oldCapacity == 0 && newCapacity > 0) if (oldCapacity == 0 && newCapacity > 0)
{ {
blockSize = memory[0].Length; _blockSize = memory[0].Length;
_blockSize = blockSize;
} }
newCapacity = memory.Length * blockSize; newCapacity = memory.Length * _blockSize;
_capacity = newCapacity; _capacity = newCapacity;
_memoryBlocks = memory; _memoryBlocks = memory;
return newCapacity; return newCapacity;