mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Replace some string.Join(string) calls with string.Join(char) (#18411)
This commit is contained in:
@@ -110,7 +110,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
|
||||
if (value != null)
|
||||
{
|
||||
_sourceCode = string.Join("\n", value);
|
||||
_sourceCode = string.Join('\n', value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6206,7 +6206,7 @@ namespace System.Management.Automation
|
||||
{
|
||||
memberName = methodCacheEntry[0].method.Name;
|
||||
isMethod = true;
|
||||
getToolTip = () => string.Join("\n", methodCacheEntry.methodInformationStructures.Select(static m => m.methodDefinition));
|
||||
getToolTip = () => string.Join('\n', methodCacheEntry.methodInformationStructures.Select(static m => m.methodDefinition));
|
||||
}
|
||||
|
||||
var psMemberInfo = member as PSMemberInfo;
|
||||
|
||||
@@ -2781,7 +2781,7 @@ namespace System.Management.Automation.Runspaces
|
||||
break;
|
||||
|
||||
case "ValidatePattern":
|
||||
string pattern = "^(" + string.Join("|", parameterValidationValues) + ")$";
|
||||
string pattern = "^(" + string.Join('|', parameterValidationValues) + ")$";
|
||||
ValidatePatternAttribute validatePattern = new ValidatePatternAttribute(pattern);
|
||||
metadata.Parameters[parameterName].Attributes.Add(validatePattern);
|
||||
break;
|
||||
|
||||
@@ -963,7 +963,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
|
||||
if (CompatiblePSEditions != null && (CompatiblePSEditions.Distinct(StringComparer.OrdinalIgnoreCase).Count() != CompatiblePSEditions.Length))
|
||||
{
|
||||
string message = StringUtil.Format(Modules.DuplicateEntriesInCompatiblePSEditions, string.Join(",", CompatiblePSEditions));
|
||||
string message = StringUtil.Format(Modules.DuplicateEntriesInCompatiblePSEditions, string.Join(',', CompatiblePSEditions));
|
||||
var ioe = new InvalidOperationException(message);
|
||||
var er = new ErrorRecord(ioe, "Modules_DuplicateEntriesInCompatiblePSEditions", ErrorCategory.InvalidArgument, CompatiblePSEditions);
|
||||
ThrowTerminatingError(er);
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
System.Globalization.CultureInfo.InvariantCulture,
|
||||
CommandBaseStrings.ExecFailed,
|
||||
Marshal.GetLastPInvokeError(),
|
||||
string.Join(" ", WithCommand)
|
||||
string.Join(' ', WithCommand)
|
||||
)
|
||||
),
|
||||
"ExecutionFailed",
|
||||
|
||||
@@ -1434,7 +1434,7 @@ namespace System.Management.Automation.Language
|
||||
|
||||
nameParts.Reverse();
|
||||
nameParts.Add(typeDefinitionAst.Name);
|
||||
return string.Join(".", nameParts);
|
||||
return string.Join('.', nameParts);
|
||||
}
|
||||
|
||||
private static readonly OpCode[] s_ldc =
|
||||
|
||||
@@ -1462,7 +1462,7 @@ else
|
||||
{
|
||||
if (groups == null) { return string.Empty; }
|
||||
|
||||
return string.Join(";", groups);
|
||||
return string.Join(';', groups);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -2470,7 +2470,7 @@ namespace System.Management.Automation.Runspaces
|
||||
var argvList = new List<string>();
|
||||
argvList.Add(psi.FileName);
|
||||
|
||||
var argsToParse = String.Join(" ", psi.ArgumentList).Trim();
|
||||
var argsToParse = String.Join(' ', psi.ArgumentList).Trim();
|
||||
var argsLength = argsToParse.Length;
|
||||
for (int i = 0; i < argsLength; )
|
||||
{
|
||||
|
||||
@@ -1632,7 +1632,7 @@ namespace System.Management.Automation
|
||||
instanceMetadata.Properties.Add(
|
||||
new PSNoteProperty(
|
||||
InternalDeserializer.CimModifiedProperties,
|
||||
string.Join(" ", namesOfModifiedProperties)));
|
||||
string.Join(' ', namesOfModifiedProperties)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -771,7 +771,7 @@ namespace System.Management.Automation
|
||||
logContext.HostId = (string)executionContext.EngineHostInterface.InstanceId.ToString();
|
||||
}
|
||||
|
||||
logContext.HostApplication = string.Join(" ", Environment.GetCommandLineArgs());
|
||||
logContext.HostApplication = string.Join(' ', Environment.GetCommandLineArgs());
|
||||
|
||||
if (executionContext.CurrentRunspace != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user