From 1a438c6a8cef99b03f6731157898d170042c4af0 Mon Sep 17 00:00:00 2001 From: Morilli <35152647+Morilli@users.noreply.github.com> Date: Wed, 18 Jun 2025 09:40:21 +0200 Subject: [PATCH] simplify CustomCollections.Contains don't think we need an explanatory comment for the return value of a library function --- src/BizHawk.Common/CustomCollections.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BizHawk.Common/CustomCollections.cs b/src/BizHawk.Common/CustomCollections.cs index 2df9d75dfd..a8ad7ee566 100644 --- a/src/BizHawk.Common/CustomCollections.cs +++ b/src/BizHawk.Common/CustomCollections.cs @@ -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);