use existing CharArrays for TrimStart() to reduce array allocations

This commit is contained in:
Chad Currie
2021-08-15 19:02:05 +12:00
parent 3c6efa6cb5
commit c72e4f224a
4 changed files with 12 additions and 6 deletions

View File

@@ -141,7 +141,7 @@ namespace Umbraco.Cms.Web.Common.AspNetCore
throw new ArgumentException("The path appears to already be fully qualified. Please remove the call to MapPath");
}
return Path.Combine(root, newPath.TrimStart('~', '/', '\\'));
return Path.Combine(root, newPath.TrimStart(Core.Constants.CharArrays.TildeForwardSlashBackSlash));
}
/// <inheritdoc/>