Skip to content

Commit

Permalink
Performance: Fixed issue in SiteMapPathHelper where a passed in start…
Browse files Browse the repository at this point in the history
…ingNodeKey would cause 2 node searches instead of 1.
  • Loading branch information
NightOwl888 committed Feb 12, 2014
1 parent c8bebb4 commit f18befb
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,12 @@ public static MvcHtmlString SiteMapPath(this MvcSiteMapHtmlHelper helper, string
/// <returns>SiteMap path for the current request</returns>
public static MvcHtmlString SiteMapPath(this MvcSiteMapHtmlHelper helper, string templateName, string startingNodeKey, SourceMetadataDictionary sourceMetadata)
{
ISiteMapNode startingNode = helper.SiteMap.CurrentNode;
if (!string.IsNullOrEmpty(startingNodeKey))
ISiteMapNode startingNode;
if (string.IsNullOrEmpty(startingNodeKey))
{
startingNode = helper.SiteMap.CurrentNode;
}
else
{
startingNode = helper.SiteMap.FindSiteMapNodeFromKey(startingNodeKey);
}
Expand Down

0 comments on commit f18befb

Please sign in to comment.