diff options
Diffstat (limited to 'csharp/src/Google.Protobuf')
-rw-r--r-- | csharp/src/Google.Protobuf/Reflection/Descriptor.cs | 4 | ||||
-rw-r--r-- | csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs | 4 | ||||
-rw-r--r-- | csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs | 8 |
3 files changed, 8 insertions, 8 deletions
diff --git a/csharp/src/Google.Protobuf/Reflection/Descriptor.cs b/csharp/src/Google.Protobuf/Reflection/Descriptor.cs index 6aad0e99..e0f1b8f5 100644 --- a/csharp/src/Google.Protobuf/Reflection/Descriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/Descriptor.cs @@ -5456,7 +5456,7 @@ namespace Google.Protobuf.Reflection { if (IdentifierValue != other.IdentifierValue) return false; if (PositiveIntValue != other.PositiveIntValue) return false; if (NegativeIntValue != other.NegativeIntValue) return false; - if (DoubleValue != other.DoubleValue) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(DoubleValue, other.DoubleValue)) return false; if (StringValue != other.StringValue) return false; if (AggregateValue != other.AggregateValue) return false; return true; @@ -5469,7 +5469,7 @@ namespace Google.Protobuf.Reflection { if (IdentifierValue.Length != 0) hash ^= IdentifierValue.GetHashCode(); if (PositiveIntValue != 0UL) hash ^= PositiveIntValue.GetHashCode(); if (NegativeIntValue != 0L) hash ^= NegativeIntValue.GetHashCode(); - if (DoubleValue != 0D) hash ^= DoubleValue.GetHashCode(); + if (DoubleValue != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(DoubleValue); if (StringValue.Length != 0) hash ^= StringValue.GetHashCode(); if (AggregateValue.Length != 0) hash ^= AggregateValue.GetHashCode(); return hash; diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs index 65119894..8468f74e 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Struct.cs @@ -368,7 +368,7 @@ namespace Google.Protobuf.WellKnownTypes { return true; } if (NullValue != other.NullValue) return false; - if (NumberValue != other.NumberValue) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(NumberValue, other.NumberValue)) return false; if (StringValue != other.StringValue) return false; if (BoolValue != other.BoolValue) return false; if (!object.Equals(StructValue, other.StructValue)) return false; @@ -381,7 +381,7 @@ namespace Google.Protobuf.WellKnownTypes { public override int GetHashCode() { int hash = 1; if (kindCase_ == KindOneofCase.NullValue) hash ^= NullValue.GetHashCode(); - if (kindCase_ == KindOneofCase.NumberValue) hash ^= NumberValue.GetHashCode(); + if (kindCase_ == KindOneofCase.NumberValue) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(NumberValue); if (kindCase_ == KindOneofCase.StringValue) hash ^= StringValue.GetHashCode(); if (kindCase_ == KindOneofCase.BoolValue) hash ^= BoolValue.GetHashCode(); if (kindCase_ == KindOneofCase.StructValue) hash ^= StructValue.GetHashCode(); diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs index 9a5fb81e..960cfdee 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs @@ -114,14 +114,14 @@ namespace Google.Protobuf.WellKnownTypes { if (ReferenceEquals(other, this)) { return true; } - if (Value != other.Value) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(Value, other.Value)) return false; return true; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (Value != 0D) hash ^= Value.GetHashCode(); + if (Value != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(Value); return hash; } @@ -239,14 +239,14 @@ namespace Google.Protobuf.WellKnownTypes { if (ReferenceEquals(other, this)) { return true; } - if (Value != other.Value) return false; + if (!pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.Equals(Value, other.Value)) return false; return true; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public override int GetHashCode() { int hash = 1; - if (Value != 0F) hash ^= Value.GetHashCode(); + if (Value != 0F) hash ^= pbc::ProtobufEqualityComparers.BitwiseSingleEqualityComparer.GetHashCode(Value); return hash; } |