From f7f42764858e72c0c1b8fabfd58a7a6261e8046c Mon Sep 17 00:00:00 2001 From: leekelleher Date: Thu, 18 Jan 2018 11:44:05 +0000 Subject: [PATCH] Removed the need for the `UseLegacyXmlSchema` check The enhancement in PR #2367 removed the `"@isDoc"` check, which was the main difference between the legacy and current XML schema. Reducing the XPath to `"//*[@key=$guid]"` will perform the same for both types of schema. _(and saves on a couple of allocations)_ --- src/Umbraco.Web/PublishedContentQuery.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Umbraco.Web/PublishedContentQuery.cs b/src/Umbraco.Web/PublishedContentQuery.cs index a609a609b7..73afcc8428 100644 --- a/src/Umbraco.Web/PublishedContentQuery.cs +++ b/src/Umbraco.Web/PublishedContentQuery.cs @@ -243,9 +243,7 @@ namespace Umbraco.Web // If not, then we perform an inefficient XPath for the GUID // todo: in v8, implement in a more efficient way - var legacyXml = UmbracoConfig.For.UmbracoSettings().Content.UseLegacyXmlSchema; - var xpath = legacyXml ? "//node[@key=$guid]" : "//*[@key=$guid]"; - doc = cache.GetSingleByXPath(xpath, new XPathVariable("guid", id.ToString())); + doc = cache.GetSingleByXPath("//*[@key=$guid]", new XPathVariable("guid", id.ToString())); // When we have the node, we add the GUID/INT value to the lookup if (doc != null)