RecyclableCollections.Contains(T item) fixes to exceptions found by tests.
This commit is contained in:
1 parent
ca6ee45bb6
commit
c2eefdfe3b
1 file changed
+1
-1
@@ -719,7 +719,7 @@ namespace Recyclable.Collections
|
||||
}
|
||||
}
|
||||
|
||||
return Array.IndexOf(memoryBlocksSpan[lastBlockIndex], item, 0, _nextItemIndex) >= 0;
|
||||
return lastBlockIndex < memoryBlocksSpan.Length && Array.IndexOf(memoryBlocksSpan[lastBlockIndex], item, 0, _nextItemIndex) >= 0;
|
||||
}
|
||||
|
||||
public void CopyTo(T[] array, int arrayIndex) => _memoryBlocks.CopyTo(0, _blockSize, _longCount, array, arrayIndex);
|
||||
|
||||
Reference in new issue
Block a user