Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ TryGetValue()

bool System.Collections.Immutable.ImmutableDictionary< TKey, TValue >.HashBucket.TryGetValue ( TKey key,
Comparers comparers,
[MaybeNullWhen(false)] out TValue value )
inlinepackage

Definition at line 835 of file ImmutableDictionary.cs.

836 {
837 if (IsEmpty)
838 {
839 value = default(TValue);
840 return false;
841 }
842 if (comparers.KeyComparer.Equals(_firstValue.Key, key))
843 {
844 value = _firstValue.Value;
845 return true;
846 }
848 int num = _additionalElements.IndexOf(item, comparers.KeyOnlyComparer);
849 if (num < 0)
850 {
851 value = default(TValue);
852 return false;
853 }
854 value = _additionalElements.ItemRef(num).Value;
855 return true;
856 }
int IndexOf(T item, int index, int count, IEqualityComparer< T >? equalityComparer)
readonly ImmutableList< KeyValuePair< TKey, TValue > >.Node _additionalElements

References System.Collections.Immutable.ImmutableDictionary< TKey, TValue >.HashBucket._additionalElements, System.Collections.Immutable.ImmutableDictionary< TKey, TValue >.HashBucket._firstValue, System.Collections.Immutable.ImmutableList< T >.IndexOf(), System.Collections.Immutable.ImmutableDictionary< TKey, TValue >.HashBucket.IsEmpty, System.item, System.Collections.Immutable.ImmutableList< T >.ItemRef(), System.key, and System.value.