aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/compiler/csharp/csharp_message.cc
diff options
context:
space:
mode:
authorGravatar Jon Skeet <jonskeet@google.com>2015-08-05 11:23:38 +0100
committerGravatar Jon Skeet <jonskeet@google.com>2015-08-05 11:23:38 +0100
commitff334a60eb2e74722867dd41b78d7c8c90bc8d0c (patch)
tree6aca2c954c9ea56bff5690d6ee7e5423a2ac13d8 /src/google/protobuf/compiler/csharp/csharp_message.cc
parent607940321c8ceeb80ec1099d94add8eef86825e5 (diff)
Change ReadTag and PeekTag to just use 0 as a return value for "end of stream", rather than using an awkward out parameter.
This simplifies quite a lot of code. Generated code in next commit.
Diffstat (limited to 'src/google/protobuf/compiler/csharp/csharp_message.cc')
-rw-r--r--src/google/protobuf/compiler/csharp/csharp_message.cc4
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"