1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-20 08:58:00 +02:00

ContainsStrict

This commit is contained in:
Brian Fiete 2022-02-15 09:37:07 -05:00
parent a3a8bfa40c
commit 682798fe7e

View file

@ -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>(TAlt item) where TAlt : IHashable where bool : operator T == TAlt
{
return IndexOfAlt(item) != -1;