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:
leekelleher
2019-03-29 12:06:23 +00:00
parent 853087a750
commit f4bd0cd1f5
21 changed files with 38 additions and 38 deletions

View File

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