RecyclableArrayList.Contains fixed to respect empty list.
This commit is contained in:
1 parent
5a39dc87f0
commit
97d5d9c6a3
1 file changed
+1
-1
@@ -374,7 +374,7 @@ namespace Recyclable.Collections
|
||||
_count = 0;
|
||||
}
|
||||
|
||||
public bool Contains(T item) => Array.IndexOf(_memoryBlock, item, 0, _count) >= 0;
|
||||
public bool Contains(T item) => _count > 0 && Array.IndexOf(_memoryBlock, item, 0, _count) >= 0;
|
||||
|
||||
public void CopyTo(T[] array, int arrayIndex) => Array.Copy(_memoryBlock, 0, array, arrayIndex, _count);
|
||||
|
||||
|
||||
Reference in new issue
Block a user