aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/compiler/csharp
diff options
context:
space:
mode:
authorGravatar Jon Skeet <jonskeet@google.com>2015-08-06 11:40:32 +0100
committerGravatar Jon Skeet <jonskeet@google.com>2015-08-06 11:40:32 +0100
commite7f88ff1294ada0fca19334ed2c844cdb98ea2f6 (patch)
tree97ab85611ecdc29c56afe217893bafa1d520fc27 /src/google/protobuf/compiler/csharp
parentad8a889d1e1e2b0efd5b7579aa57ea5326cda6da (diff)
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.)
Diffstat (limited to 'src/google/protobuf/compiler/csharp')
-rw-r--r--src/google/protobuf/compiler/csharp/csharp_message.cc5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/google/protobuf/compiler/csharp/csharp_message.cc b/src/google/protobuf/compiler/csharp/csharp_message.cc
index 40c13de5..a71a7909 100644
--- a/src/google/protobuf/compiler/csharp/csharp_message.cc
+++ b/src/google/protobuf/compiler/csharp/csharp_message.cc
@@ -423,10 +423,7 @@ void MessageGenerator::GenerateMergingMethods(io::Printer* printer) {
printer->Indent();
printer->Print(
"default:\n"
- " if (pb::WireFormat.IsEndGroupTag(tag)) {\n"
- " return;\n"
- " }\n"
- " input.ConsumeLastField();\n" // We're not storing the data, but we still need to consume it.
+ " input.SkipLastField();\n" // We're not storing the data, but we still need to consume it.
" break;\n");
for (int i = 0; i < fields_by_number().size(); i++) {
const FieldDescriptor* field = fields_by_number()[i];