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

◆ GetRuleCache< T >()

RuleCache< T > System.Runtime.CompilerServices.CallSiteBinder.GetRuleCache< T > ( )
inlinepackage
Type Constraints
T :class 

Definition at line 104 of file CallSiteBinder.cs.

104 : class
105 {
106 if (Cache == null)
107 {
109 }
111 object value;
112 lock (cache)
113 {
114 if (!cache.TryGetValue(typeof(T), out value))
115 {
116 value = (cache[typeof(T)] = new RuleCache<T>());
117 }
118 }
119 return value as RuleCache<T>;
120 }
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
static int CompareExchange(ref int location1, int value, int comparand)

References System.Runtime.CompilerServices.CallSiteBinder.Cache, System.Threading.Interlocked.CompareExchange(), System.Collections.Generic.Dictionary< TKey, TValue >.TryGetValue(), and System.value.

Referenced by System.Runtime.CompilerServices.CallSiteBinder.CacheTarget< T >().