-Refactor JsonSerializer.GetConverter
This commit is contained in:
@@ -389,7 +389,7 @@ namespace Newtonsoft.Json
|
||||
{
|
||||
Type converterType;
|
||||
|
||||
if (!ConverterTypeCache.ContainsKey(attributeProvider))
|
||||
if (!ConverterTypeCache.TryGetValue(attributeProvider, out converterType))
|
||||
{
|
||||
JsonConverterAttribute converterAttribute = ReflectionUtils.GetAttribute<JsonConverterAttribute>(attributeProvider, true);
|
||||
converterType = (converterAttribute != null)
|
||||
@@ -398,10 +398,6 @@ namespace Newtonsoft.Json
|
||||
|
||||
ConverterTypeCache[attributeProvider] = converterType;
|
||||
}
|
||||
else
|
||||
{
|
||||
converterType = ConverterTypeCache[attributeProvider];
|
||||
}
|
||||
|
||||
if (converterType != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user