diff options
author | Jon Skeet <skeet@pobox.com> | 2009-05-28 21:45:43 +0100 |
---|---|---|
committer | Jon Skeet <skeet@pobox.com> | 2009-05-28 21:45:43 +0100 |
commit | 43da7ae328b699d9c6e64ea909e348fac3506f73 (patch) | |
tree | cc85fa0319866900fc93b5e90e224550206a5c2b /src/ProtocolBuffers/AbstractMessage.cs | |
parent | 7ee85c4e9f1a94ff4f0a1adbdeb4716a0c519ea7 (diff) | |
download | protobuf-43da7ae328b699d9c6e64ea909e348fac3506f73.tar.gz protobuf-43da7ae328b699d9c6e64ea909e348fac3506f73.tar.bz2 protobuf-43da7ae328b699d9c6e64ea909e348fac3506f73.zip |
Fix equality of messages to include unknown fields
Diffstat (limited to 'src/ProtocolBuffers/AbstractMessage.cs')
-rw-r--r-- | src/ProtocolBuffers/AbstractMessage.cs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ProtocolBuffers/AbstractMessage.cs b/src/ProtocolBuffers/AbstractMessage.cs index 11bb948e..27cd77ba 100644 --- a/src/ProtocolBuffers/AbstractMessage.cs +++ b/src/ProtocolBuffers/AbstractMessage.cs @@ -213,13 +213,14 @@ namespace Google.ProtocolBuffers { if (otherMessage == null || otherMessage.DescriptorForType != DescriptorForType) { return false; } - return Dictionaries.Equals(AllFields, otherMessage.AllFields); + return Dictionaries.Equals(AllFields, otherMessage.AllFields) && UnknownFields.Equals(otherMessage.UnknownFields); } public override int GetHashCode() { int hash = 41; hash = (19 * hash) + DescriptorForType.GetHashCode(); hash = (53 * hash) + Dictionaries.GetHashCode(AllFields); + hash = (29 * hash) + UnknownFields.GetHashCode(); return hash; } } |