Skip to content

Commit 8869fb9

Browse files
committed
Simplify string join operation
1 parent 27b044d commit 8869fb9

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

StyleCop.Analyzers/StyleCop.Analyzers.Test/MaintainabilityRules/DebugMessagesUnitTestsBase.cs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -297,16 +297,7 @@ protected Task VerifyCSharpDiagnosticAsync(string source, DiagnosticResult[] exp
297297
protected virtual string BuildTestCode(string format)
298298
{
299299
StringBuilder argumentList = new StringBuilder();
300-
foreach (var argument in this.InitialArguments)
301-
{
302-
if (argumentList.Length > 0)
303-
{
304-
argumentList.Append(", ");
305-
}
306-
307-
argumentList.Append(argument);
308-
}
309-
300+
argumentList.Append(string.Join(", ", this.InitialArguments));
310301
if (argumentList.Length > 0)
311302
{
312303
argumentList.Append(", ");

0 commit comments

Comments
 (0)