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

◆ Insert()

void System.Reflection.CerHashtable< K, V >.Table.Insert ( K key,
V value )
inlinepackage

Definition at line 23 of file CerHashtable.cs.

24 {
25 int num = CerHashtable<K, V>.GetHashCodeHelper(key);
26 if (num < 0)
27 {
28 num = ~num;
29 }
30 K[] keys = m_keys;
31 int num2 = num % keys.Length;
32 while (true)
33 {
34 K val = keys[num2];
35 if (val == null)
36 {
37 break;
38 }
39 num2++;
40 if (num2 >= keys.Length)
41 {
42 num2 -= keys.Length;
43 }
44 }
45 m_count++;
46 m_values[num2] = value;
47 Volatile.Write(ref keys[num2], key);
48 }
static void Write(ref bool location, bool value)
Definition Volatile.cs:74

References System.Reflection.CerHashtable< K, V >.GetHashCodeHelper(), System.key, System.keys, System.Reflection.CerHashtable< K, V >.Table.m_count, System.Reflection.CerHashtable< K, V >.Table.m_keys, System.Reflection.CerHashtable< K, V >.Table.m_values, System.value, and System.Threading.Volatile.Write().

Referenced by System.Reflection.CerHashtable< K, V >.Rehash().