summary refs log tree commit diff
path: root/crypto
diff options
context:
space:
mode:
Diffstat (limited to 'crypto')
-rw-r--r--crypto/src/asn1/DERExternal.cs12
-rw-r--r--crypto/src/util/Objects.cs10
-rw-r--r--crypto/src/util/Platform.cs5
3 files changed, 16 insertions, 11 deletions
diff --git a/crypto/src/asn1/DERExternal.cs b/crypto/src/asn1/DERExternal.cs

index 1806b5296..9fba95165 100644 --- a/crypto/src/asn1/DERExternal.cs +++ b/crypto/src/asn1/DERExternal.cs
@@ -156,9 +156,9 @@ namespace Org.BouncyCastle.Asn1 protected override int Asn1GetHashCode() { - return Platform.GetHashCode(this.directReference) - ^ Platform.GetHashCode(this.indirectReference) - ^ Platform.GetHashCode(this.dataValueDescriptor) + return Objects.GetHashCode(this.directReference) + ^ Objects.GetHashCode(this.indirectReference) + ^ Objects.GetHashCode(this.dataValueDescriptor) ^ this.encoding ^ this.externalContent.GetHashCode(); } @@ -167,9 +167,9 @@ namespace Org.BouncyCastle.Asn1 { DerExternal that = asn1Object as DerExternal; return null != that - && Platform.Equals(this.directReference, that.directReference) - && Platform.Equals(this.indirectReference, that.indirectReference) - && Platform.Equals(this.dataValueDescriptor, that.dataValueDescriptor) + && Equals(this.directReference, that.directReference) + && Equals(this.indirectReference, that.indirectReference) + && Equals(this.dataValueDescriptor, that.dataValueDescriptor) && this.encoding == that.encoding && this.externalContent.Equals(that.externalContent); } diff --git a/crypto/src/util/Objects.cs b/crypto/src/util/Objects.cs new file mode 100644
index 000000000..4d49ac9de --- /dev/null +++ b/crypto/src/util/Objects.cs
@@ -0,0 +1,10 @@ +namespace Org.BouncyCastle.Utilities +{ + public static class Objects + { + public static int GetHashCode(object obj) + { + return null == obj ? 0 : obj.GetHashCode(); + } + } +} diff --git a/crypto/src/util/Platform.cs b/crypto/src/util/Platform.cs
index 7e79c64e1..75b728bd9 100644 --- a/crypto/src/util/Platform.cs +++ b/crypto/src/util/Platform.cs
@@ -26,11 +26,6 @@ namespace Org.BouncyCastle.Utilities } } - internal static int GetHashCode(object obj) - { - return null == obj ? 0 : obj.GetHashCode(); - } - internal static void Dispose(IDisposable d) { d.Dispose();