Remove additional premature uses of C#7 features
This commit is contained in:
@@ -241,8 +241,10 @@ namespace Umbraco.Web
|
||||
var tmpNodes = cache.GetXPathNavigator().Select("//*[@nodeTypeAlias]");
|
||||
foreach (XPathNavigator tmpNode in tmpNodes)
|
||||
{
|
||||
if (int.TryParse(tmpNode.GetAttribute("id", string.Empty), out int tmpNodeId)
|
||||
&& Guid.TryParse(tmpNode.GetAttribute("key", string.Empty), out Guid tmpNodeKey))
|
||||
int tmpNodeId;
|
||||
Guid tmpNodeKey;
|
||||
if (int.TryParse(tmpNode.GetAttribute("id", string.Empty), out tmpNodeId)
|
||||
&& Guid.TryParse(tmpNode.GetAttribute("key", string.Empty), out tmpNodeKey))
|
||||
{
|
||||
_guidToIntLoopkup[tmpNodeKey] = tmpNodeId;
|
||||
}
|
||||
@@ -252,8 +254,9 @@ namespace Umbraco.Web
|
||||
|
||||
IPublishedContent doc;
|
||||
|
||||
// Check if the lookup contains the GUID/INT value
|
||||
if (_guidToIntLoopkup.TryGetValue(id, out int nodeId) == false)
|
||||
// Check if the lookup contains the GUID/INT value
|
||||
int nodeId;
|
||||
if (_guidToIntLoopkup.TryGetValue(id, out nodeId) == false)
|
||||
{
|
||||
// If not, then we perform an inefficient XPath for the GUID
|
||||
|
||||
@@ -460,4 +463,4 @@ namespace Umbraco.Web
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user