Skip to content

Commit 8973b0c

Browse files
authored
Use overload APIs that take char instead of string when it's possible (PowerShell#18179)
1 parent d66b2a5 commit 8973b0c

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

src/Microsoft.PowerShell.Commands.Management/commands/management/RegisterWMIEventCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ private string GetScopeString(string computer, string namespaceParameter)
9191
{
9292
StringBuilder returnValue = new StringBuilder("\\\\");
9393
returnValue.Append(computer);
94-
returnValue.Append("\\");
94+
returnValue.Append('\\');
9595
returnValue.Append(namespaceParameter);
9696
return returnValue.ToString();
9797
}

src/Microsoft.PowerShell.Commands.Management/commands/management/WMIHelper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ internal static string GetScopeString(string computer, string namespaceParameter
10421042
{
10431043
StringBuilder returnValue = new StringBuilder("\\\\");
10441044
returnValue.Append(computer);
1045-
returnValue.Append("\\");
1045+
returnValue.Append('\\');
10461046
returnValue.Append(namespaceParameter);
10471047
return returnValue.ToString();
10481048
}
@@ -1659,7 +1659,7 @@ private string ConstructLocation()
16591659
foreach (PSWmiChildJob job in ChildJobs)
16601660
{
16611661
location.Append(job.Location);
1662-
location.Append(",");
1662+
location.Append(',');
16631663
}
16641664

16651665
location.Remove(location.Length - 1, 1);

src/Microsoft.PowerShell.Security/security/CertificateProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1568,7 +1568,7 @@ private static string NormalizePath(string path)
15681568

15691569
string[] elts = GetPathElements(path);
15701570

1571-
path = string.Join("\\", elts);
1571+
path = string.Join('\\', elts);
15721572
}
15731573

15741574
return path;

src/System.Management.Automation/DscSupport/CimDSCParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,7 @@ public static List<CimClass> ImportClasses(string path, Tuple<string, Version> m
992992
// allow sharing of nested objects.
993993
if (!IsSameNestedObject(cimClass, c))
994994
{
995-
var files = string.Join(",", GetFileDefiningClass(className));
995+
var files = string.Join(',', GetFileDefiningClass(className));
996996
PSInvalidOperationException e = PSTraceSource.NewInvalidOperationException(
997997
ParserStrings.DuplicateCimClassDefinition, className, path, files);
998998

src/System.Management.Automation/engine/CommandDiscovery.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ internal static void VerifyPSEdition(ExternalScriptInfo scriptInfo)
454454
//
455455
if (isRequiresPSEditionSpecified && !isCurrentEditionListed)
456456
{
457-
var specifiedEditionsString = string.Join(",", scriptInfo.RequiresPSEditions);
457+
var specifiedEditionsString = string.Join(',', scriptInfo.RequiresPSEditions);
458458
var message = StringUtil.Format(DiscoveryExceptions.RequiresPSEditionNotCompatible,
459459
scriptInfo.Name,
460460
specifiedEditionsString,

test/tools/WebListener/Controllers/LinkController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public JsonResult Index()
8787
}
8888
else
8989
{
90-
linkHeader = string.Join(",", linkList);
90+
linkHeader = string.Join(',', linkList);
9191
}
9292

9393
Response.Headers.Add("Link", linkHeader);

0 commit comments

Comments
 (0)