From e7f88ff1294ada0fca19334ed2c844cdb98ea2f6 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Thu, 6 Aug 2015 11:40:32 +0100 Subject: Skip groups properly. Now the generated code doesn't need to check for end group tags, as it will skip whole groups at a time. Currently it will ignore extraneous end group tags, which may or may not be a good thing. Renamed ConsumeLastField to SkipLastField as it felt more natural. Removed WireFormat.IsEndGroupTag as it's no longer useful. This mostly fixes issue 688. (Generated code changes coming in next commit.) --- csharp/src/Google.Protobuf/Collections/MapField.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'csharp/src/Google.Protobuf/Collections/MapField.cs') diff --git a/csharp/src/Google.Protobuf/Collections/MapField.cs b/csharp/src/Google.Protobuf/Collections/MapField.cs index 5eb2c2fc..dc4b04cb 100644 --- a/csharp/src/Google.Protobuf/Collections/MapField.cs +++ b/csharp/src/Google.Protobuf/Collections/MapField.cs @@ -637,10 +637,9 @@ namespace Google.Protobuf.Collections { Value = codec.valueCodec.Read(input); } - else if (WireFormat.IsEndGroupTag(tag)) + else { - // TODO(jonskeet): Do we need this? (Given that we don't support groups...) - return; + input.SkipLastField(); } } } -- cgit v1.2.3