mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-20 17:08:00 +02:00
Add ContainsAlt to Dictionary
This commit is contained in:
parent
5b02c68372
commit
5b2801cbae
1 changed files with 13 additions and 0 deletions
|
@ -277,6 +277,19 @@ namespace System.Collections
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool ContainsAlt<TAltKey>((TAltKey key, TValue value) kvPair) where TAltKey : IHashable where bool : operator TKey == TAltKey
|
||||||
|
{
|
||||||
|
TValue value;
|
||||||
|
if (TryGetValueAlt(kvPair.key, out value))
|
||||||
|
{
|
||||||
|
return value == kvPair.value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void CopyTo(Span<KeyValuePair> kvPair)
|
public void CopyTo(Span<KeyValuePair> kvPair)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue