-Refactor JsonSerializer.GetConverter

This commit is contained in:
JamesNK
2008-09-08 09:10:00 +00:00
parent ce0148d67f
commit b991969d65
+1 -5
View File
@@ -389,7 +389,7 @@ namespace Newtonsoft.Json
{ {
Type converterType; Type converterType;
if (!ConverterTypeCache.ContainsKey(attributeProvider)) if (!ConverterTypeCache.TryGetValue(attributeProvider, out converterType))
{ {
JsonConverterAttribute converterAttribute = ReflectionUtils.GetAttribute<JsonConverterAttribute>(attributeProvider, true); JsonConverterAttribute converterAttribute = ReflectionUtils.GetAttribute<JsonConverterAttribute>(attributeProvider, true);
converterType = (converterAttribute != null) converterType = (converterAttribute != null)
@@ -398,10 +398,6 @@ namespace Newtonsoft.Json
ConverterTypeCache[attributeProvider] = converterType; ConverterTypeCache[attributeProvider] = converterType;
} }
else
{
converterType = ConverterTypeCache[attributeProvider];
}
if (converterType != null) if (converterType != null)
{ {