diff options
author | Jon Skeet <jonskeet@google.com> | 2015-08-05 11:23:38 +0100 |
---|---|---|
committer | Jon Skeet <jonskeet@google.com> | 2015-08-05 11:23:38 +0100 |
commit | ff334a60eb2e74722867dd41b78d7c8c90bc8d0c (patch) | |
tree | 6aca2c954c9ea56bff5690d6ee7e5423a2ac13d8 /src/google | |
parent | 607940321c8ceeb80ec1099d94add8eef86825e5 (diff) | |
download | protobuf-ff334a60eb2e74722867dd41b78d7c8c90bc8d0c.tar.gz protobuf-ff334a60eb2e74722867dd41b78d7c8c90bc8d0c.tar.bz2 protobuf-ff334a60eb2e74722867dd41b78d7c8c90bc8d0c.zip |
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')
-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" |