Avoid intermediate strings in some StringBuilder formatting (#22111)
authorStephen Toub <stoub@microsoft.com>
Mon, 21 Jan 2019 21:20:18 +0000 (16:20 -0500)
committerGitHub <noreply@github.com>
Mon, 21 Jan 2019 21:20:18 +0000 (16:20 -0500)
commit401e931714e9b0890aaaa047710d0eb582bb8722
treeaaa793feae354a85a4d3a707188f4e872e5726be
parenta5c5feb8939ae6ae10d9d2b7f2bc8d43ed99bc38
Avoid intermediate strings in some StringBuilder formatting (#22111)

* Avoid intermediate strings in some StringBuilder formatting

Several appends to string builders are first creating strings and then appending those strings, and they're not using the existing Append(primitive) overloads because they want to customize the format string or provider as part of appending the value.  This fixes a few of those cases, using another internal AppendSpanFormattable overload on StringBuilder.

* Address PR feedback
src/System.Private.CoreLib/shared/System/Globalization/DateTimeFormat.cs
src/System.Private.CoreLib/shared/System/Globalization/TimeSpanFormat.cs
src/System.Private.CoreLib/shared/System/Text/StringBuilder.cs
src/System.Private.CoreLib/shared/System/TimeZoneInfo.StringSerializer.cs