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 /csharp/src/Google.Protobuf/Collections | |
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 'csharp/src/Google.Protobuf/Collections')
-rw-r--r-- | csharp/src/Google.Protobuf/Collections/MapField.cs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/csharp/src/Google.Protobuf/Collections/MapField.cs b/csharp/src/Google.Protobuf/Collections/MapField.cs index fed3d062..5eb2c2fc 100644 --- a/csharp/src/Google.Protobuf/Collections/MapField.cs +++ b/csharp/src/Google.Protobuf/Collections/MapField.cs @@ -627,12 +627,8 @@ namespace Google.Protobuf.Collections public void MergeFrom(CodedInputStream input) { uint tag; - while (input.ReadTag(out tag)) + while ((tag = input.ReadTag()) != 0) { - if (tag == 0) - { - throw InvalidProtocolBufferException.InvalidTag(); - } if (tag == codec.keyCodec.Tag) { Key = codec.keyCodec.Read(input); |