From b991969d65f2d845ebb1cb86d91b60770028a7b8 Mon Sep 17 00:00:00 2001 From: JamesNK Date: Mon, 8 Sep 2008 09:10:00 +0000 Subject: [PATCH] -Refactor JsonSerializer.GetConverter --- Src/Newtonsoft.Json/JsonSerializer.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Src/Newtonsoft.Json/JsonSerializer.cs b/Src/Newtonsoft.Json/JsonSerializer.cs index 9e89733d..4db23a49 100644 --- a/Src/Newtonsoft.Json/JsonSerializer.cs +++ b/Src/Newtonsoft.Json/JsonSerializer.cs @@ -389,7 +389,7 @@ namespace Newtonsoft.Json { Type converterType; - if (!ConverterTypeCache.ContainsKey(attributeProvider)) + if (!ConverterTypeCache.TryGetValue(attributeProvider, out converterType)) { JsonConverterAttribute converterAttribute = ReflectionUtils.GetAttribute(attributeProvider, true); converterType = (converterAttribute != null) @@ -398,10 +398,6 @@ namespace Newtonsoft.Json ConverterTypeCache[attributeProvider] = converterType; } - else - { - converterType = ConverterTypeCache[attributeProvider]; - } if (converterType != null) {