diff options
Diffstat (limited to 'csharp/src/Google.Protobuf/JsonParser.cs')
-rw-r--r-- | csharp/src/Google.Protobuf/JsonParser.cs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/csharp/src/Google.Protobuf/JsonParser.cs b/csharp/src/Google.Protobuf/JsonParser.cs index 6d2638d9..9710e675 100644 --- a/csharp/src/Google.Protobuf/JsonParser.cs +++ b/csharp/src/Google.Protobuf/JsonParser.cs @@ -37,7 +37,6 @@ using System.Collections; using System.Collections.Generic; using System.Globalization; using System.IO; -using System.Linq; using System.Text; using System.Text.RegularExpressions; @@ -164,11 +163,7 @@ namespace Google.Protobuf throw new InvalidProtocolBufferException("Expected an object"); } var descriptor = message.Descriptor; - // TODO: Make this more efficient, e.g. by building it once in the descriptor. - // Additionally, we need to consider whether to parse field names in their original proto form, - // and any overrides in the descriptor. But yes, all of this should be in the descriptor somehow... - // the descriptor can expose the dictionary. - var jsonFieldMap = descriptor.Fields.InDeclarationOrder().ToDictionary(field => JsonFormatter.ToCamelCase(field.Name)); + var jsonFieldMap = descriptor.Fields.ByJsonName(); while (true) { token = tokenizer.Next(); |