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)_
This commit is contained in:
leekelleher
2018-01-18 11:44:05 +00:00
parent bb9e23ca3e
commit f7f4276485

View File

@@ -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)