AggregateException: Use StringBuilder.AppendFormat (#15747)
authorJustin Van Patten <jvp@justinvp.com>
Fri, 5 Jan 2018 06:10:46 +0000 (22:10 -0800)
committerJan Kotas <jkotas@microsoft.com>
Fri, 5 Jan 2018 06:10:46 +0000 (22:10 -0800)
Use `AppendFormat(...)` instead of `Append(string.Format(...))` and
`AppendLine()` instead of `Append(Environment.NewLine)`.

src/mscorlib/shared/System/AggregateException.cs

index 36b9494..99ba703 100644 (file)
@@ -453,12 +453,12 @@ namespace System
 
             for (int i = 0; i < m_innerExceptions.Count; i++)
             {
-                text.Append(Environment.NewLine);
+                text.AppendLine();
                 text.Append("---> ");
-                text.Append(string.Format(CultureInfo.InvariantCulture, SR.AggregateException_InnerException, i));
+                text.AppendFormat(CultureInfo.InvariantCulture, SR.AggregateException_InnerException, i);
                 text.Append(m_innerExceptions[i].ToString());
                 text.Append("<---");
-                text.Append(Environment.NewLine);
+                text.AppendLine();
             }
 
             return text.ToString();