From 2740a60b80c7e8043ef9524525452084dde8b2b2 Mon Sep 17 00:00:00 2001 From: mlemanczyk Date: Sun, 8 Oct 2023 19:20:08 +0200 Subject: [PATCH] Failing tests fixed. --- .../RecyclableLongList.IndexOfHelpers.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Recyclable.Collections/RecyclableLongList.IndexOfHelpers.cs b/Recyclable.Collections/RecyclableLongList.IndexOfHelpers.cs index a7f1b50..1ee976c 100644 --- a/Recyclable.Collections/RecyclableLongList.IndexOfHelpers.cs +++ b/Recyclable.Collections/RecyclableLongList.IndexOfHelpers.cs @@ -307,31 +307,31 @@ namespace Recyclable.Collections itemIndex = Array.IndexOf(memoryBlocksSpan[blockIndex], item, 0, list._blockSize); if (itemIndex >= 0) { - return itemIndex + (long)blockIndex << list._blockSizePow2BitShift; + return itemIndex + ((long)blockIndex << list._blockSizePow2BitShift); } - if (blockIndex + 1 < list._lastBlockWithData) + if (blockIndex + 1 < list._lastBlockWithData) { itemIndex = Array.IndexOf(memoryBlocksSpan[blockIndex + 1], item, 0, list._blockSize); if (itemIndex >= 0) { - return itemIndex + (long)(blockIndex + 1)<< list._blockSizePow2BitShift; + return itemIndex + ((long)(blockIndex + 1) << list._blockSizePow2BitShift); } - if (blockIndex + 2 < list._lastBlockWithData) + if (blockIndex + 2 < list._lastBlockWithData) { itemIndex = Array.IndexOf(memoryBlocksSpan[blockIndex + 2], item, 0, list._blockSize); if (itemIndex >= 0) { - return itemIndex + (long)(blockIndex + 2)<< list._blockSizePow2BitShift; + return itemIndex + ((long)(blockIndex + 2) << list._blockSizePow2BitShift); } - if (blockIndex + 3 < list._lastBlockWithData) + if (blockIndex + 3 < list._lastBlockWithData) { itemIndex = Array.IndexOf(memoryBlocksSpan[blockIndex + 3], item, 0, list._blockSize); if (itemIndex >= 0) { - return itemIndex + (long)(blockIndex + 3)<< list._blockSizePow2BitShift; + return itemIndex + ((long)(blockIndex + 3) << list._blockSizePow2BitShift); } } } @@ -342,7 +342,7 @@ namespace Recyclable.Collections ? Array.IndexOf(memoryBlocksSpan[list._lastBlockWithData], item, 0, list._nextItemIndex) : Array.IndexOf(memoryBlocksSpan[list._lastBlockWithData], item, 0, list._blockSize); - return itemIndex >= 0 ? itemIndex + (long)list._lastBlockWithData << list._blockSizePow2BitShift : RecyclableDefaults.ItemNotFoundIndexLong; + return itemIndex >= 0 ? itemIndex + ((long)list._lastBlockWithData << list._blockSizePow2BitShift) : RecyclableDefaults.ItemNotFoundIndexLong; } } }