simplify CustomCollections.Contains
don't think we need an explanatory comment for the return value of a library function
This commit is contained in:
parent
515b510da0
commit
1a438c6a8c
|
@ -84,7 +84,7 @@ namespace BizHawk.Common
|
|||
|
||||
public virtual void Clear() => _list.Clear();
|
||||
|
||||
public virtual bool Contains(T item) => !(_list.BinarySearch(item) < 0); // can't use `!= -1`, BinarySearch can return multiple negative values
|
||||
public virtual bool Contains(T item) => _list.BinarySearch(item) >= 0;
|
||||
|
||||
bool IList.Contains(object? item)
|
||||
=> item is T item1 && Contains(item1);
|
||||
|
|
Loading…
Reference in New Issue