diff options
author | Jan Tattermusch <jtattermusch@users.noreply.github.com> | 2015-08-05 17:16:13 -0700 |
---|---|---|
committer | Jan Tattermusch <jtattermusch@users.noreply.github.com> | 2015-08-05 17:16:13 -0700 |
commit | ad8a889d1e1e2b0efd5b7579aa57ea5326cda6da (patch) | |
tree | 48e9e14f18ee1ff081df8d26a361665b9d458f74 /src | |
parent | 607940321c8ceeb80ec1099d94add8eef86825e5 (diff) | |
parent | 38032688a7faf4eef2cac392b9e69697a202fe62 (diff) |
Merge pull request #692 from jskeet/tag-0
Change ReadTag/PeekTag behaviour to return 0 at EOF
Diffstat (limited to 'src')
-rw-r--r-- | src/google/protobuf/compiler/csharp/csharp_message.cc | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/google/protobuf/compiler/csharp/csharp_message.cc b/src/google/protobuf/compiler/csharp/csharp_message.cc index ea722455..40c13de5 100644 --- a/src/google/protobuf/compiler/csharp/csharp_message.cc +++ b/src/google/protobuf/compiler/csharp/csharp_message.cc @@ -417,13 +417,11 @@ void MessageGenerator::GenerateMergingMethods(io::Printer* printer) { printer->Indent(); printer->Print( "uint tag;\n" - "while (input.ReadTag(out tag)) {\n" + "while ((tag = input.ReadTag()) != 0) {\n" " switch(tag) {\n"); printer->Indent(); printer->Indent(); printer->Print( - "case 0:\n" // 0 signals EOF / limit reached - " throw pb::InvalidProtocolBufferException.InvalidTag();\n" "default:\n" " if (pb::WireFormat.IsEndGroupTag(tag)) {\n" " return;\n" |