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

◆ GetValueOrDefault< TKey, TValue >() [2/2]

static TValue System.Collections.Immutable.ImmutableDictionary< TKey, TValue >.GetValueOrDefault< TKey, TValue > ( this IImmutableDictionary< TKey, TValue > dictionary,
TKey key,
TValue defaultValue )
inlinestatic
Type Constraints
TKey :notnull 

Definition at line 124 of file ImmutableDictionary.cs.

124 : notnull
125 {
126 Requires.NotNull(dictionary, "dictionary");
127 Requires.NotNullAllowStructs(key, "key");
128 if (dictionary.TryGetValue(key, out TValue value))
129 {
130 return value;
131 }
132 return defaultValue;
133 }

References System.dictionary, System.key, and System.value.