diff --git a/Recyclable.Collections/RecyclableLongList.cs b/Recyclable.Collections/RecyclableLongList.cs index 5aa8da0..b316a72 100644 --- a/Recyclable.Collections/RecyclableLongList.cs +++ b/Recyclable.Collections/RecyclableLongList.cs @@ -921,10 +921,7 @@ namespace Recyclable.Collections if (_nextItemIndex > 0) { - if (--_nextItemIndex == 0) - { - _lastBlockWithData--; - } + _nextItemIndex--; } else { @@ -932,6 +929,11 @@ namespace Recyclable.Collections _nextItemBlockIndex--; } + if (_nextItemIndex == 0) + { + _lastBlockWithData--; + } + if (NeedsClearing) { #nullable disable @@ -987,10 +989,7 @@ namespace Recyclable.Collections if (_nextItemIndex > 0) { - if (--_nextItemIndex == 0) - { - _lastBlockWithData--; - } + _nextItemIndex--; } else { @@ -998,6 +997,11 @@ namespace Recyclable.Collections _nextItemBlockIndex--; } + if (_nextItemIndex == 0) + { + _lastBlockWithData--; + } + if (NeedsClearing) { #nullable disable @@ -1023,10 +1027,7 @@ namespace Recyclable.Collections if (_nextItemIndex > 0) { - if (--_nextItemIndex == 0) - { - _lastBlockWithData--; - } + _nextItemIndex--; } else { @@ -1034,6 +1035,11 @@ namespace Recyclable.Collections _nextItemBlockIndex--; } + if (_nextItemIndex == 0) + { + _lastBlockWithData--; + } + if (NeedsClearing) { #nullable disable