RecyclableArrayList.Contains fixed to not throw exception when the list is empty.
RecyclableArrayList tests sorted alphabetically, simplified & extended to use the test data & validate various combinations of item counts & block sizes.
This commit is contained in:
1 parent
070549de9e
commit
277e52f701
2 files changed
+149
-152
No files matched your search
@@ -372,7 +372,7 @@ namespace Recyclable.Collections
|
||||
_count = 0;
|
||||
}
|
||||
|
||||
public bool Contains(T item) => _memoryBlock.Contains(item);
|
||||
public bool Contains(T item) => Array.IndexOf(_memoryBlock, 0, _count) >= 0;
|
||||
|
||||
public void CopyTo(T[] array, int arrayIndex) => Array.Copy(_memoryBlock, 0, array, arrayIndex, _count);
|
||||
|
||||
|
||||
Reference in new issue
Block a user