Merge pull request #7353 from davkean/RemoveUnneededAllocations
Remove unneeded char[] allocations
This commit is contained in:
commit
fffe3142ad
1 changed files with 4 additions and 2 deletions
|
@ -11,6 +11,8 @@ namespace Microsoft.DotNet.Cli.Utils
|
|||
{
|
||||
public class EnvironmentProvider : IEnvironmentProvider
|
||||
{
|
||||
private static char[] s_pathSeparator = new char[] { Path.PathSeparator };
|
||||
private static char[] s_quote = new char[] { '"' };
|
||||
private IEnumerable<string> _searchPaths;
|
||||
private IEnumerable<string> _executableExtensions;
|
||||
|
||||
|
@ -42,8 +44,8 @@ namespace Microsoft.DotNet.Cli.Utils
|
|||
|
||||
searchPaths.AddRange(Environment
|
||||
.GetEnvironmentVariable("PATH")
|
||||
.Split(Path.PathSeparator)
|
||||
.Select(p => p.Trim('"')));
|
||||
.Split(s_pathSeparator)
|
||||
.Select(p => p.Trim(s_quote)));
|
||||
|
||||
_searchPaths = searchPaths;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue