From b334d8f19ce198b8f15ecdc0051845b31f30e26e Mon Sep 17 00:00:00 2001 From: mlemanczyk Date: Sat, 16 Sep 2023 21:41:38 +0200 Subject: [PATCH] Tiny cleanup. Order in file of RemoveBlock fixed. --- Recyclable.Collections/RecyclableLongList.cs | 44 ++++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/Recyclable.Collections/RecyclableLongList.cs b/Recyclable.Collections/RecyclableLongList.cs index 99c9fc5..818ceb4 100644 --- a/Recyclable.Collections/RecyclableLongList.cs +++ b/Recyclable.Collections/RecyclableLongList.cs @@ -549,28 +549,6 @@ namespace Recyclable.Collections return false; } - public void RemoveBlock(int index) - { - if (_blockSize >= RecyclableDefaults.MinPooledArrayLength) - { - RecyclableArrayPool.ReturnShared(_memoryBlocks[index], _needsClearing); - } - - _memoryBlocks[index] = null; - _capacity -= _blockSize; - if (_nextItemBlockIndex == index) - { - _nextItemIndex = 0; - } - else if (_nextItemBlockIndex > index) - { - _nextItemBlockIndex--; - } - - _lastBlockWithData--; - _version++; - } - [MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)] public void RemoveAt(int index) { @@ -647,6 +625,28 @@ namespace Recyclable.Collections _version++; } + public void RemoveBlock(int index) + { + if (_blockSize >= RecyclableDefaults.MinPooledArrayLength) + { + RecyclableArrayPool.ReturnShared(_memoryBlocks[index], _needsClearing); + } + + _memoryBlocks[index] = null; + _capacity -= _blockSize; + if (_nextItemBlockIndex == index) + { + _nextItemIndex = 0; + } + else if (_nextItemBlockIndex > index) + { + _nextItemBlockIndex--; + } + + _lastBlockWithData--; + _version++; + } + public void Dispose() { _version++;