Skip to content

Commit 6445f5b

Browse files
authored
Fix several new CA1830 diagnostics (#121131)
From updates in dotnet/sdk#51215
1 parent 9215568 commit 6445f5b

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

src/coreclr/tools/Common/Compiler/DisplayNameHelpers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public override Unit AppendName(StringBuilder sb, ArrayType type, FormatOptions
157157
AppendName(sb, type.ElementType, options);
158158
sb.Append('[');
159159
if (type.Rank > 1)
160-
sb.Append(new string(',', type.Rank - 1));
160+
sb.Append(',', type.Rank - 1);
161161
sb.Append(']');
162162
return default;
163163
}

src/coreclr/tools/Common/Compiler/ProcessLinkerXmlBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ public override void AppendName(StringBuilder sb, ArrayType type)
579579
AppendName(sb, type.ElementType);
580580
sb.Append('[');
581581
if (type.Rank > 1)
582-
sb.Append(new string(',', type.Rank - 1));
582+
sb.Append(',', type.Rank - 1);
583583
sb.Append(']');
584584
}
585585
public override void AppendName(StringBuilder sb, ByRefType type)

src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/CustomConverterTests/CustomConverterTests.ReadAhead.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ private static string CreateTestStringProperty(int stringSize)
6666
private static void AppendTestString(int i, int stringSize, StringBuilder builder)
6767
{
6868
builder.Append(@"""");
69-
builder.Append(new string(i.ToString()[0], stringSize));
69+
builder.Append(i.ToString()[0], stringSize);
7070
builder.Append(@"""");
7171
}
7272

src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexNode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3169,7 +3169,7 @@ public override string ToString()
31693169
curNode = curNode.Child(curChild);
31703170
curChild = 0;
31713171

3172-
sb.Append(new string(' ', stack.Count * 2)).Append(curNode.Describe()).AppendLine();
3172+
sb.Append(' ', stack.Count * 2).Append(curNode.Describe()).AppendLine();
31733173
}
31743174
else
31753175
{

src/tools/illink/src/linker/Linker/Driver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public static void ParseResponseFile(TextReader reader, Queue<string> result)
185185
numBackslash /= 2;
186186
}
187187
if (numBackslash > 0)
188-
argBuilder.Append(new string('\\', numBackslash));
188+
argBuilder.Append('\\', numBackslash);
189189
if (cur < 0 || (!inquote && char.IsWhiteSpace((char)cur)))
190190
break;
191191
if (copyChar)

0 commit comments

Comments
 (0)