Commit 3e7d70cb authored by Jon Skeet's avatar Jon Skeet

Generated code changes due to map changes.

(Primarily this is starting the hash code of messages at a non-zero value...)
parent df44ae44
...@@ -155,7 +155,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook { ...@@ -155,7 +155,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
} }
public override int GetHashCode() { public override int GetHashCode() {
int hash = 0; int hash = 17;
if (Name.Length != 0) hash ^= Name.GetHashCode(); if (Name.Length != 0) hash ^= Name.GetHashCode();
if (Id != 0) hash ^= Id.GetHashCode(); if (Id != 0) hash ^= Id.GetHashCode();
if (Email.Length != 0) hash ^= Email.GetHashCode(); if (Email.Length != 0) hash ^= Email.GetHashCode();
...@@ -200,6 +200,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook { ...@@ -200,6 +200,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
} }
return size; return size;
} }
public void MergeFrom(Person other) { public void MergeFrom(Person other) {
if (other == null) { if (other == null) {
return; return;
...@@ -329,7 +330,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook { ...@@ -329,7 +330,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
} }
public override int GetHashCode() { public override int GetHashCode() {
int hash = 0; int hash = 17;
if (Number.Length != 0) hash ^= Number.GetHashCode(); if (Number.Length != 0) hash ^= Number.GetHashCode();
if (Type != global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType.HOME) hash ^= Type.GetHashCode(); if (Type != global::Google.ProtocolBuffers.Examples.AddressBook.Person.Types.PhoneType.HOME) hash ^= Type.GetHashCode();
return hash; return hash;
...@@ -356,6 +357,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook { ...@@ -356,6 +357,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
} }
return size; return size;
} }
public void MergeFrom(PhoneNumber other) { public void MergeFrom(PhoneNumber other) {
if (other == null) { if (other == null) {
return; return;
...@@ -456,7 +458,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook { ...@@ -456,7 +458,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
} }
public override int GetHashCode() { public override int GetHashCode() {
int hash = 0; int hash = 17;
hash ^= person_.GetHashCode(); hash ^= person_.GetHashCode();
return hash; return hash;
} }
...@@ -477,6 +479,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook { ...@@ -477,6 +479,7 @@ namespace Google.ProtocolBuffers.Examples.AddressBook {
} }
return size; return size;
} }
public void MergeFrom(AddressBook other) { public void MergeFrom(AddressBook other) {
if (other == null) { if (other == null) {
return; return;
......
...@@ -120,7 +120,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -120,7 +120,7 @@ namespace Google.Protobuf.TestProtos {
} }
public override int GetHashCode() { public override int GetHashCode() {
int hash = 0; int hash = 17;
if (D != 0) hash ^= D.GetHashCode(); if (D != 0) hash ^= D.GetHashCode();
return hash; return hash;
} }
...@@ -139,6 +139,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -139,6 +139,7 @@ namespace Google.Protobuf.TestProtos {
} }
return size; return size;
} }
public void MergeFrom(ImportMessage other) { public void MergeFrom(ImportMessage other) {
if (other == null) { if (other == null) {
return; return;
......
...@@ -105,7 +105,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -105,7 +105,7 @@ namespace Google.Protobuf.TestProtos {
} }
public override int GetHashCode() { public override int GetHashCode() {
int hash = 0; int hash = 17;
if (E != 0) hash ^= E.GetHashCode(); if (E != 0) hash ^= E.GetHashCode();
return hash; return hash;
} }
...@@ -124,6 +124,7 @@ namespace Google.Protobuf.TestProtos { ...@@ -124,6 +124,7 @@ namespace Google.Protobuf.TestProtos {
} }
return size; return size;
} }
public void MergeFrom(PublicImportMessage other) { public void MergeFrom(PublicImportMessage other) {
if (other == null) { if (other == null) {
return; return;
......
...@@ -168,7 +168,7 @@ namespace UnitTest.Issues.TestProtos { ...@@ -168,7 +168,7 @@ namespace UnitTest.Issues.TestProtos {
} }
public override int GetHashCode() { public override int GetHashCode() {
int hash = 0; int hash = 17;
if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.NEGATIVE_ENUM_ZERO) hash ^= Value.GetHashCode(); if (Value != global::UnitTest.Issues.TestProtos.NegativeEnum.NEGATIVE_ENUM_ZERO) hash ^= Value.GetHashCode();
hash ^= values_.GetHashCode(); hash ^= values_.GetHashCode();
hash ^= packedValues_.GetHashCode(); hash ^= packedValues_.GetHashCode();
...@@ -212,6 +212,7 @@ namespace UnitTest.Issues.TestProtos { ...@@ -212,6 +212,7 @@ namespace UnitTest.Issues.TestProtos {
} }
return size; return size;
} }
public void MergeFrom(NegativeEnumMessage other) { public void MergeFrom(NegativeEnumMessage other) {
if (other == null) { if (other == null) {
return; return;
...@@ -303,7 +304,7 @@ namespace UnitTest.Issues.TestProtos { ...@@ -303,7 +304,7 @@ namespace UnitTest.Issues.TestProtos {
} }
public override int GetHashCode() { public override int GetHashCode() {
int hash = 0; int hash = 17;
return hash; return hash;
} }
...@@ -314,6 +315,7 @@ namespace UnitTest.Issues.TestProtos { ...@@ -314,6 +315,7 @@ namespace UnitTest.Issues.TestProtos {
int size = 0; int size = 0;
return size; return size;
} }
public void MergeFrom(DeprecatedChild other) { public void MergeFrom(DeprecatedChild other) {
if (other == null) { if (other == null) {
return; return;
...@@ -456,7 +458,7 @@ namespace UnitTest.Issues.TestProtos { ...@@ -456,7 +458,7 @@ namespace UnitTest.Issues.TestProtos {
} }
public override int GetHashCode() { public override int GetHashCode() {
int hash = 0; int hash = 17;
if (PrimitiveValue != 0) hash ^= PrimitiveValue.GetHashCode(); if (PrimitiveValue != 0) hash ^= PrimitiveValue.GetHashCode();
hash ^= primitiveArray_.GetHashCode(); hash ^= primitiveArray_.GetHashCode();
if (messageValue_ != null) hash ^= MessageValue.GetHashCode(); if (messageValue_ != null) hash ^= MessageValue.GetHashCode();
...@@ -527,6 +529,7 @@ namespace UnitTest.Issues.TestProtos { ...@@ -527,6 +529,7 @@ namespace UnitTest.Issues.TestProtos {
} }
return size; return size;
} }
public void MergeFrom(DeprecatedFieldsMessage other) { public void MergeFrom(DeprecatedFieldsMessage other) {
if (other == null) { if (other == null) {
return; return;
...@@ -655,7 +658,7 @@ namespace UnitTest.Issues.TestProtos { ...@@ -655,7 +658,7 @@ namespace UnitTest.Issues.TestProtos {
} }
public override int GetHashCode() { public override int GetHashCode() {
int hash = 0; int hash = 17;
if (Item != 0) hash ^= Item.GetHashCode(); if (Item != 0) hash ^= Item.GetHashCode();
return hash; return hash;
} }
...@@ -674,6 +677,7 @@ namespace UnitTest.Issues.TestProtos { ...@@ -674,6 +677,7 @@ namespace UnitTest.Issues.TestProtos {
} }
return size; return size;
} }
public void MergeFrom(ItemField other) { public void MergeFrom(ItemField other) {
if (other == null) { if (other == null) {
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment