fix bug for Field Presence

pull/306/head
Jie Luo 10 years ago
parent 856ced5d76
commit 5a811ac6f9
  1. 2
      src/google/protobuf/compiler/csharp/csharp_enum_field.cc
  2. 2
      src/google/protobuf/compiler/csharp/csharp_primitive_field.cc

@ -170,7 +170,7 @@ void EnumFieldGenerator::WriteHash(Writer* writer) {
} else {
writer->WriteLine("if ($0$ != $1$) {", property_name(), default_value());
}
writer->WriteLine(" hash ^= $1$_.GetHashCode();", name());
writer->WriteLine(" hash ^= $0$_.GetHashCode();", name());
writer->WriteLine("}");
}
void EnumFieldGenerator::WriteEquals(Writer* writer) {

@ -161,7 +161,7 @@ void PrimitiveFieldGenerator::WriteHash(Writer* writer) {
} else {
writer->WriteLine("if ($0$ != $1$) {", property_name(), default_value());
}
writer->WriteLine(" hash ^= $1$_.GetHashCode();", name());
writer->WriteLine(" hash ^= $0$_.GetHashCode();", name());
writer->WriteLine("}");
}
void PrimitiveFieldGenerator::WriteEquals(Writer* writer) {

Loading…
Cancel
Save