From 682798fe7eac06bd40d9d6cf7f8f87f5cc9c2d7e Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Tue, 15 Feb 2022 09:37:07 -0500 Subject: [PATCH] ContainsStrict --- BeefLibs/corlib/src/Collections/List.bf | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/BeefLibs/corlib/src/Collections/List.bf b/BeefLibs/corlib/src/Collections/List.bf index 70a4e7fb..02d7d1a5 100644 --- a/BeefLibs/corlib/src/Collections/List.bf +++ b/BeefLibs/corlib/src/Collections/List.bf @@ -448,6 +448,24 @@ namespace System.Collections } } + public bool ContainsStrict(T item) + { + if (item == null) + { + for (int i = 0; i < mSize; i++) + if (mItems[i] === null) + return true; + return false; + } + else + { + for (int i = 0; i < mSize; i++) + if (mItems[i] === item) + return true; + return false; + } + } + public bool ContainsAlt(TAlt item) where TAlt : IHashable where bool : operator T == TAlt { return IndexOfAlt(item) != -1;