RecyclableLongList.Contains fixed to cover border cases. Failing tests fixed.
This commit is contained in:
1 parent
4b2722f15a
commit
68582f0ffd
2 files changed
+2
-2
No files matched your search
@@ -337,7 +337,7 @@ namespace Recyclable.Collections
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_nextItemBlockIndex == 0 || (_nextItemBlockIndex == 1 && _nextItemIndex == 0))
|
if (_nextItemBlockIndex == 0 || (_nextItemIndex == 0 && _nextItemBlockIndex == 1))
|
||||||
{
|
{
|
||||||
return Array.IndexOf(_memoryBlocks[0], item, 0, checked((int)_longCount)) >= 0;
|
return Array.IndexOf(_memoryBlocks[0], item, 0, checked((int)_longCount)) >= 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ namespace Recyclable.CollectionsTests
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Validate
|
// Validate
|
||||||
_ = list.Capacity.Should().Be(0);
|
_ = list.Capacity.Should().BeGreaterThanOrEqualTo(RecyclableDefaults.InitialCapacity);
|
||||||
_ = list.LastBlockWithData.Should().Be(-1);
|
_ = list.LastBlockWithData.Should().Be(-1);
|
||||||
_ = list.LongCount.Should().Be(itemsCount);
|
_ = list.LongCount.Should().Be(itemsCount);
|
||||||
_ = list.Should().BeEmpty();
|
_ = list.Should().BeEmpty();
|
||||||
|
|||||||
Reference in new issue
Block a user