aboutsummaryrefslogtreecommitdiffhomepage
path: root/csharp/src/Google.Protobuf/FieldCodec.cs
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 /csharp/src/Google.Protobuf/FieldCodec.cs
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 'csharp/src/Google.Protobuf/FieldCodec.cs')
-rw-r--r--csharp/src/Google.Protobuf/FieldCodec.cs6
1 files changed, 1 insertions, 5 deletions
diff --git a/csharp/src/Google.Protobuf/FieldCodec.cs b/csharp/src/Google.Protobuf/FieldCodec.cs
index 1076c2a9..15d52c7d 100644
--- a/csharp/src/Google.Protobuf/FieldCodec.cs
+++ b/csharp/src/Google.Protobuf/FieldCodec.cs
@@ -298,12 +298,8 @@ namespace Google.Protobuf
uint tag;
T value = codec.DefaultValue;
- while (input.ReadTag(out tag))
+ while ((tag = input.ReadTag()) != 0)
{
- if (tag == 0)
- {
- throw InvalidProtocolBufferException.InvalidTag();
- }
if (tag == codec.Tag)
{
value = codec.Read(input);