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

◆ this[object key]

object? System.Collections.Specialized.HybridDictionary.this[object key]
getset

Implements System.Collections.IDictionary.

Definition at line 15 of file HybridDictionary.cs.

16 {
17 get
18 {
19 ListDictionary listDictionary = list;
20 if (hashtable != null)
21 {
22 return hashtable[key];
23 }
24 if (listDictionary != null)
25 {
26 return listDictionary[key];
27 }
28 if (key == null)
29 {
30 throw new ArgumentNullException("key");
31 }
32 return null;
33 }
34 set
35 {
36 if (hashtable != null)
37 {
39 }
40 else if (list != null)
41 {
42 if (list.Count >= 8)
43 {
44 ChangeOver();
46 }
47 else
48 {
49 list[key] = value;
50 }
51 }
52 else
53 {
54 list = new ListDictionary(caseInsensitive ? StringComparer.OrdinalIgnoreCase : null);
55 list[key] = value;
56 }
57 }
58 }