diff options
author | Jon Skeet <skeet@pobox.com> | 2016-03-07 09:37:43 +0000 |
---|---|---|
committer | Jon Skeet <skeet@pobox.com> | 2016-03-07 09:37:43 +0000 |
commit | f2d34086766ae33d3c945408f8dd3044921b1435 (patch) | |
tree | 134dbc222ab9d13bcbfbf8ac5c637856005aa09e /csharp/src/Google.Protobuf/Collections/MapField.cs | |
parent | 9242d9b7f431e40d119faef8b583d945362ef04c (diff) | |
parent | ad2d775e1b8d56477d0ab39b6148c361766c91f1 (diff) | |
download | protobuf-f2d34086766ae33d3c945408f8dd3044921b1435.tar.gz protobuf-f2d34086766ae33d3c945408f8dd3044921b1435.tar.bz2 protobuf-f2d34086766ae33d3c945408f8dd3044921b1435.zip |
Merge pull request #1301 from avgweb/master
Replace StringBuilder with TextWriter in JsonFormatter
Diffstat (limited to 'csharp/src/Google.Protobuf/Collections/MapField.cs')
-rw-r--r-- | csharp/src/Google.Protobuf/Collections/MapField.cs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/csharp/src/Google.Protobuf/Collections/MapField.cs b/csharp/src/Google.Protobuf/Collections/MapField.cs index 90a5ff1a..993a89d7 100644 --- a/csharp/src/Google.Protobuf/Collections/MapField.cs +++ b/csharp/src/Google.Protobuf/Collections/MapField.cs @@ -34,6 +34,7 @@ using Google.Protobuf.Reflection; using System; using System.Collections; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Text; using Google.Protobuf.Compatibility; @@ -474,9 +475,9 @@ namespace Google.Protobuf.Collections /// </summary> public override string ToString() { - var builder = new StringBuilder(); - JsonFormatter.Default.WriteDictionary(builder, this); - return builder.ToString(); + var writer = new StringWriter(); + JsonFormatter.Default.WriteDictionary(writer, this); + return writer.ToString(); } #region IDictionary explicit interface implementation |