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

◆ Add()

void System.Dynamic.Utils.CacheDict< TKey, TValue >.Add ( TKey key,
TValue value )
inlinepackage

Definition at line 69 of file CacheDict.cs.

70 {
71 int hashCode = key.GetHashCode();
72 int num = hashCode & _mask;
73 Entry entry = Volatile.Read(ref _entries[num]);
74 if (entry == null || entry._hash != hashCode || !entry._key.Equals(key))
75 {
76 Volatile.Write(ref _entries[num], new Entry(hashCode, key, value));
77 }
78 }
readonly Entry[] _entries
Definition CacheDict.cs:26
static bool Read(ref bool location)
Definition Volatile.cs:67
static void Write(ref bool location, bool value)
Definition Volatile.cs:74

References System.Dynamic.Utils.CacheDict< TKey, TValue >._entries, System.Dynamic.Utils.CacheDict< TKey, TValue >.Entry._hash, System.Dynamic.Utils.CacheDict< TKey, TValue >.Entry._key, System.Dynamic.Utils.CacheDict< TKey, TValue >._mask, System.key, System.Threading.Volatile.Read(), System.value, and System.Threading.Volatile.Write().