diff --git a/src/CodeStyle/Core/Analyzers/Microsoft.CodeAnalysis.CodeStyle.csproj b/src/CodeStyle/Core/Analyzers/Microsoft.CodeAnalysis.CodeStyle.csproj index 8aacd2f15a61305efea8b499fb8201d934cd4756..5ea923488da1183ebd8cb68f76148cc71c4c7db4 100644 --- a/src/CodeStyle/Core/Analyzers/Microsoft.CodeAnalysis.CodeStyle.csproj +++ b/src/CodeStyle/Core/Analyzers/Microsoft.CodeAnalysis.CodeStyle.csproj @@ -32,7 +32,6 @@ - @@ -57,6 +56,7 @@ + diff --git a/src/Compilers/Core/Portable/InternalUtilities/Hash.cs b/src/Compilers/Core/Portable/InternalUtilities/Hash.cs index d5e45ff9f5c9b3ddea0175e32939d64e7a4b85b8..497477248f664aa89acd624d17c54595a49e20fa 100644 --- a/src/Compilers/Core/Portable/InternalUtilities/Hash.cs +++ b/src/Compilers/Core/Portable/InternalUtilities/Hash.cs @@ -171,7 +171,6 @@ internal static int GetFNVHashCode(byte[] data) return hashCode; } -#if !CODE_STYLE /// /// Compute the FNV-1a hash of a sequence of bytes and determines if the byte /// sequence is valid ASCII and hence the hash code matches a char sequence @@ -197,7 +196,6 @@ internal static int GetFNVHashCode(ReadOnlySpan data, out bool isAscii) isAscii = (asciiMask & 0x80) == 0; return hashCode; } -#endif /// /// Compute the FNV-1a hash of a sequence of bytes diff --git a/src/Workspaces/Core/Portable/CodeStyle/CodeStyleOption.cs b/src/Workspaces/Core/Portable/CodeStyle/CodeStyleOption.cs index 29b9c700685e31db9f6a677a33ae8357afe201aa..8b2a6e8be93ea25941754915c59b09258a85a756 100644 --- a/src/Workspaces/Core/Portable/CodeStyle/CodeStyleOption.cs +++ b/src/Workspaces/Core/Portable/CodeStyle/CodeStyleOption.cs @@ -189,6 +189,6 @@ public override bool Equals(object obj) Equals(option); public override int GetHashCode() - => Hash.Combine(Value.GetHashCode(), Notification.GetHashCode()); + => unchecked((Notification.GetHashCode() * (int)0xA5555529) + Value.GetHashCode()); } } diff --git a/src/Workspaces/Core/Portable/Options/OptionKey.cs b/src/Workspaces/Core/Portable/Options/OptionKey.cs index 8b9903457030e4c79a9164ebe32c8b92e0d3b303..f06e862e6b4523ef16953723ccad5ce1a83f36b9 100644 --- a/src/Workspaces/Core/Portable/Options/OptionKey.cs +++ b/src/Workspaces/Core/Portable/Options/OptionKey.cs @@ -46,7 +46,7 @@ public override int GetHashCode() if (Language != null) { - hash = Hash.Combine(Language.GetHashCode(), hash); + hash = unchecked((hash * (int)0xA5555529) + Language.GetHashCode()); } return hash;