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:
@@ -94,7 +94,7 @@ namespace Umbraco.Web.Editors
|
||||
|
||||
// if the parentId is root (-1) then we just need an empty string as we are
|
||||
// creating the path below and we don't want -1 in the path
|
||||
if (parentId == Core.Constants.System.Root.ToInvariantString())
|
||||
if (parentId == Core.Constants.System.RootString)
|
||||
{
|
||||
parentId = string.Empty;
|
||||
}
|
||||
@@ -276,7 +276,7 @@ namespace Umbraco.Web.Editors
|
||||
// Make sure that the root virtual path ends with '/'
|
||||
codeFileDisplay.VirtualPath = codeFileDisplay.VirtualPath.EnsureEndsWith("/");
|
||||
|
||||
if (id != Core.Constants.System.Root.ToInvariantString())
|
||||
if (id != Core.Constants.System.RootString)
|
||||
{
|
||||
codeFileDisplay.VirtualPath += id.TrimStart("/").EnsureEndsWith("/");
|
||||
//if it's not new then it will have a path, otherwise it won't
|
||||
|
||||
Reference in New Issue
Block a user