Remove additional premature uses of C#7 features

This commit is contained in:
Sebastiaan Jansssen
2018-01-29 14:35:30 +01:00
parent 83595ecaf5
commit 7cd540c37e
3 changed files with 26 additions and 13 deletions

View File

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