From 8869fb95b67a153c6d5a47ca64b58f9aa2106461 Mon Sep 17 00:00:00 2001 From: Sam Harwell Date: Fri, 8 Nov 2019 05:53:35 -0800 Subject: [PATCH] Simplify string join operation --- .../DebugMessagesUnitTestsBase.cs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/StyleCop.Analyzers/StyleCop.Analyzers.Test/MaintainabilityRules/DebugMessagesUnitTestsBase.cs b/StyleCop.Analyzers/StyleCop.Analyzers.Test/MaintainabilityRules/DebugMessagesUnitTestsBase.cs index 91de30efc..34357a0e8 100644 --- a/StyleCop.Analyzers/StyleCop.Analyzers.Test/MaintainabilityRules/DebugMessagesUnitTestsBase.cs +++ b/StyleCop.Analyzers/StyleCop.Analyzers.Test/MaintainabilityRules/DebugMessagesUnitTestsBase.cs @@ -297,16 +297,7 @@ protected Task VerifyCSharpDiagnosticAsync(string source, DiagnosticResult[] exp protected virtual string BuildTestCode(string format) { StringBuilder argumentList = new StringBuilder(); - foreach (var argument in this.InitialArguments) - { - if (argumentList.Length > 0) - { - argumentList.Append(", "); - } - - argumentList.Append(argument); - } - + argumentList.Append(string.Join(", ", this.InitialArguments)); if (argumentList.Length > 0) { argumentList.Append(", ");