From 8bcb05a84a8eb53b4592735db0fa37e414fbe6c5 Mon Sep 17 00:00:00 2001 From: NOlbert <45466413+N-Olbert@users.noreply.github.com> Date: Fri, 5 Dec 2025 22:49:45 +0100 Subject: [PATCH] Cache null values in XML documentation cache --- .../Descriptors/Conventions/XmlDocumentationFileResolver.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/HotChocolate/Core/src/Types/Types/Descriptors/Conventions/XmlDocumentationFileResolver.cs b/src/HotChocolate/Core/src/Types/Types/Descriptors/Conventions/XmlDocumentationFileResolver.cs index 58530014338..2d25ebf48d4 100644 --- a/src/HotChocolate/Core/src/Types/Types/Descriptors/Conventions/XmlDocumentationFileResolver.cs +++ b/src/HotChocolate/Core/src/Types/Types/Descriptors/Conventions/XmlDocumentationFileResolver.cs @@ -12,7 +12,7 @@ public class XmlDocumentationFileResolver : IXmlDocumentationFileResolver private readonly Func? _resolveXmlDocumentationFileName; - private readonly ConcurrentDictionary _cache = + private readonly ConcurrentDictionary _cache = new(StringComparer.OrdinalIgnoreCase); public XmlDocumentationFileResolver() @@ -38,8 +38,9 @@ public bool TryGetXmlDocument( if (xmlDocumentFileName is not null && File.Exists(xmlDocumentFileName)) { doc = XDocument.Load(xmlDocumentFileName, LoadOptions.PreserveWhitespace); - _cache[fullName] = doc; } + + _cache[fullName] = doc; } document = doc;