Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
◆
this[TKey key]
TValue
System.Linq.Expressions.Interpreter.HybridReferenceDictionary
< TKey, TValue >.
this
[TKey
key
]
get
set
Definition at line
12
of file
HybridReferenceDictionary.cs
.
13
{
14
get
15
{
16
if
(
TryGetValue
(
key
,
out
var
value
))
17
{
18
return
value
;
19
}
20
throw
new
KeyNotFoundException
(
System
.
SR
.
Format
(
System
.
SR
.
Arg_KeyNotFoundWithKey
,
key
.ToString()));
21
}
22
set
23
{
24
if
(
_dict
!=
null
)
25
{
26
_dict
[
key
] =
value
;
27
return
;
28
}
29
int
num;
30
if
(
_keysAndValues
!=
null
)
31
{
32
num = -1;
33
for
(
int
i = 0;
i
<
_keysAndValues
.Length;
i
++)
34
{
35
if
(
_keysAndValues
[i].Key ==
key
)
36
{
37
_keysAndValues
[
i
] =
new
KeyValuePair<TKey, TValue>
(
key
,
value
);
38
return
;
39
}
40
if
(
_keysAndValues
[i].Key ==
null
)
41
{
42
num =
i
;
43
}
44
}
45
}
46
else
47
{
48
_keysAndValues
=
new
KeyValuePair<TKey, TValue>
[10];
49
num = 0;
50
}
51
if
(num != -1)
52
{
53
_keysAndValues
[num] =
new
KeyValuePair<TKey, TValue>
(
key
,
value
);
54
return
;
55
}
56
_dict
=
new
Dictionary<TKey, TValue>
();
57
for
(
int
j
= 0;
j
<
_keysAndValues
.Length;
j
++)
58
{
59
_dict
[
_keysAndValues
[
j
].Key] =
_keysAndValues
[
j
].Value;
60
}
61
_keysAndValues
=
null
;
62
_dict
[
key
] =
value
;
63
}
64
}
System.Collections.Generic.Dictionary
Definition
Dictionary.cs:14
System.Collections.Generic.KeyNotFoundException
Definition
KeyNotFoundException.cs:9
System.Linq.Expressions.Interpreter.HybridReferenceDictionary.TryGetValue
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
Definition
HybridReferenceDictionary.cs:66
System.Linq.Expressions.Interpreter.HybridReferenceDictionary._dict
Dictionary< TKey, TValue > _dict
Definition
HybridReferenceDictionary.cs:10
System.Linq.Expressions.Interpreter.HybridReferenceDictionary._keysAndValues
KeyValuePair< TKey, TValue >[] _keysAndValues
Definition
HybridReferenceDictionary.cs:8
System.SR.Format
static string Format(string resourceFormat, object p1)
Definition
SR.cs:118
System.SR.Arg_KeyNotFoundWithKey
static string Arg_KeyNotFoundWithKey
Definition
SR.cs:94
System.SR
Definition
SR.cs:7
System.Text.RegularExpressions.ExceptionArgument.i
@ i
System.ExceptionArgument.value
@ value
System.ExceptionArgument.key
@ key
System
Definition
BlockingCollection.cs:8
System
Linq
Expressions
Interpreter
HybridReferenceDictionary
Generated by
1.10.0