aboutsummaryrefslogtreecommitdiff
path: root/src/google
diff options
context:
space:
mode:
authorJie Luo <anandolee@gmail.com>2015-04-27 14:27:21 -0700
committerJie Luo <anandolee@gmail.com>2015-04-27 14:27:21 -0700
commit5a811ac6f9d92a6875a7a1e0f1cdb8058640cc62 (patch)
treeb6a58a2eccf0627ef707f6e1be1d3e95419e53bd /src/google
parent856ced5d767c7f4d0eb30eb28f5831c16871b149 (diff)
downloadprotobuf-5a811ac6f9d92a6875a7a1e0f1cdb8058640cc62.tar.gz
protobuf-5a811ac6f9d92a6875a7a1e0f1cdb8058640cc62.tar.bz2
protobuf-5a811ac6f9d92a6875a7a1e0f1cdb8058640cc62.zip
fix bug for Field Presence
Diffstat (limited to 'src/google')
-rw-r--r--src/google/protobuf/compiler/csharp/csharp_enum_field.cc2
-rw-r--r--src/google/protobuf/compiler/csharp/csharp_primitive_field.cc2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/google/protobuf/compiler/csharp/csharp_enum_field.cc b/src/google/protobuf/compiler/csharp/csharp_enum_field.cc
index 1fbd1c6c..34d1c5c6 100644
--- a/src/google/protobuf/compiler/csharp/csharp_enum_field.cc
+++ b/src/google/protobuf/compiler/csharp/csharp_enum_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) {
diff --git a/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc b/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc
index 10e886eb..a193afda 100644
--- a/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc
+++ b/src/google/protobuf/compiler/csharp/csharp_primitive_field.cc
@@ -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) {