misc clean up of locks and add more readonly.

UtilizationStatistics.cs: "deep copy" statistics out
This commit is contained in:
nopjmp
2019-12-16 19:50:19 -06:00
parent 392e1395c4
commit 8d0ea08ca7
11 changed files with 315 additions and 302 deletions

View File

@@ -281,16 +281,16 @@ namespace LitJson
private static MethodInfo GetConvOp (Type t1, Type t2)
{
lock (conv_ops_lock) {
if (! conv_ops.ContainsKey (t1))
conv_ops.Add (t1, new Dictionary<Type, MethodInfo> ());
lock (conv_ops_lock)
{
if (!conv_ops.ContainsKey(t1))
conv_ops.Add(t1, new Dictionary<Type, MethodInfo>());
if (conv_ops[t1].ContainsKey(t2))
return conv_ops[t1][t2];
}
if (conv_ops[t1].ContainsKey (t2))
return conv_ops[t1][t2];
MethodInfo op = t1.GetMethod (
"op_Implicit", new Type[] { t2 });
var op = t1.GetMethod("op_Implicit", new[] { t2 });
lock (conv_ops_lock) {
try {