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:
@@ -120,7 +120,7 @@ namespace Umbraco.Web.Trees
|
||||
{
|
||||
var nodes = new TreeNodeCollection();
|
||||
|
||||
var rootIdString = Constants.System.Root.ToString(CultureInfo.InvariantCulture);
|
||||
var rootIdString = Constants.System.RootString;
|
||||
var hasAccessToRoot = UserStartNodes.Contains(Constants.System.Root);
|
||||
|
||||
var startNodeId = queryStrings.HasKey(TreeQueryStringParameters.StartNodeId)
|
||||
@@ -256,7 +256,7 @@ namespace Umbraco.Web.Trees
|
||||
protected sealed override TreeNodeCollection GetTreeNodes(string id, FormDataCollection queryStrings)
|
||||
{
|
||||
//check if we're rendering the root
|
||||
if (id == Constants.System.Root.ToInvariantString() && UserStartNodes.Contains(Constants.System.Root))
|
||||
if (id == Constants.System.RootString && UserStartNodes.Contains(Constants.System.Root))
|
||||
{
|
||||
var altStartId = string.Empty;
|
||||
|
||||
@@ -264,7 +264,7 @@ namespace Umbraco.Web.Trees
|
||||
altStartId = queryStrings.GetValue<string>(TreeQueryStringParameters.StartNodeId);
|
||||
|
||||
//check if a request has been made to render from a specific start node
|
||||
if (string.IsNullOrEmpty(altStartId) == false && altStartId != "undefined" && altStartId != Constants.System.Root.ToString(CultureInfo.InvariantCulture))
|
||||
if (string.IsNullOrEmpty(altStartId) == false && altStartId != "undefined" && altStartId != Constants.System.RootString)
|
||||
{
|
||||
id = altStartId;
|
||||
}
|
||||
@@ -272,7 +272,7 @@ namespace Umbraco.Web.Trees
|
||||
var nodes = GetTreeNodesInternal(id, queryStrings);
|
||||
|
||||
//only render the recycle bin if we are not in dialog and the start id id still the root
|
||||
if (IsDialog(queryStrings) == false && id == Constants.System.Root.ToInvariantString())
|
||||
if (IsDialog(queryStrings) == false && id == Constants.System.RootString)
|
||||
{
|
||||
nodes.Add(CreateTreeNode(
|
||||
RecycleBinId.ToInvariantString(),
|
||||
|
||||
Reference in New Issue
Block a user