mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-20 08:58:00 +02:00
ContainsStrict
This commit is contained in:
parent
a3a8bfa40c
commit
682798fe7e
1 changed files with 18 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue