From a42e568fdfac44613c0b8abd4609737494948df1 Mon Sep 17 00:00:00 2001 From: leekelleher Date: Wed, 24 Jan 2018 11:51:53 +0000 Subject: [PATCH] Initialized the ConcurrentDictionary statically as per @JimBobSquarePants's comment: https://github.com/umbraco/Umbraco-CMS/pull/2398#discussion_r162799543 --- src/Umbraco.Web/PublishedContentQuery.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Umbraco.Web/PublishedContentQuery.cs b/src/Umbraco.Web/PublishedContentQuery.cs index 4a36f1b3a4..e865f13121 100644 --- a/src/Umbraco.Web/PublishedContentQuery.cs +++ b/src/Umbraco.Web/PublishedContentQuery.cs @@ -227,13 +227,10 @@ namespace Umbraco.Web return doc; } - private static ConcurrentDictionary _guidToIntLoopkup; + private static readonly ConcurrentDictionary _guidToIntLoopkup = new ConcurrentDictionary(); private IPublishedContent TypedDocumentById(Guid id, ContextualPublishedCache cache) { - // We create the lookup when we first need it - if (_guidToIntLoopkup == null) - _guidToIntLoopkup = new ConcurrentDictionary(); IPublishedContent doc;