-Refactor JsonSerializer.GetConverter
This commit is contained in:
@@ -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)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user