mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-19 00:20:25 +02:00
Simpler ContainsValue
This commit is contained in:
parent
664909e0e3
commit
d08b45018c
1 changed files with 2 additions and 18 deletions
|
@ -258,25 +258,9 @@ namespace System.Collections
|
||||||
|
|
||||||
public bool ContainsValue(TValue value)
|
public bool ContainsValue(TValue value)
|
||||||
{
|
{
|
||||||
if (value == null)
|
for (int_cosize i = 0; i < mCount; i++)
|
||||||
{
|
{
|
||||||
for (int_cosize i = 0; i < mCount; i++)
|
if (mEntries[i].mHashCode >= 0 && mEntries[i].mValue == null) return true;
|
||||||
{
|
|
||||||
if (mEntries[i].mHashCode >= 0 && mEntries[i].mValue == null) return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (int_cosize i = 0; i < mCount; i++)
|
|
||||||
{
|
|
||||||
if (mEntries[i].mHashCode >= 0 && mEntries[i].mValue == value) return true;
|
|
||||||
}
|
|
||||||
//TODO: comparison
|
|
||||||
/*EqualityComparer<TValue> c = EqualityComparer<TValue>.Default;
|
|
||||||
for (int i = 0; i < count; i++)
|
|
||||||
{
|
|
||||||
if (entries[i].hashCode >= 0 && c.Equals(entries[i].value, value)) return true;
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue