Swapped all System.Root string conversions
to use the `System.RootString` constant. This saves on integer parsing and reduces the number of new strings being created. Since the `System.Root` is `-1`, it didn't need the culture invariant conversion.
This commit is contained in:
@@ -44,7 +44,7 @@ namespace Umbraco.Web.Trees
|
||||
{
|
||||
var nodes = new TreeNodeCollection();
|
||||
|
||||
var found = id == Constants.System.Root.ToInvariantString()
|
||||
var found = id == Constants.System.RootString
|
||||
? Services.FileService.GetTemplates(-1)
|
||||
: Services.FileService.GetTemplates(int.Parse(id));
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace Umbraco.Web.Trees
|
||||
var item = menu.Items.Add<ActionNew>(Services.TextService, opensDialog: true);
|
||||
item.NavigateToRoute($"{queryStrings.GetRequiredValue<string>("application")}/templates/edit/{id}?create=true");
|
||||
|
||||
if (id == Constants.System.Root.ToInvariantString())
|
||||
if (id == Constants.System.RootString)
|
||||
{
|
||||
//refresh action
|
||||
menu.Items.Add(new RefreshNode(Services.TextService, true));
|
||||
|
||||
Reference in New Issue
Block a user