1
0
Fork 0
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:
disarray2077 2021-10-27 23:37:09 -03:00
parent 5b02c68372
commit 5b2801cbae

View file

@ -277,6 +277,19 @@ namespace System.Collections
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)
{