Skip to content

Commit

Permalink
Remove the Code Style dependency on Hash.cs
Browse files Browse the repository at this point in the history
Reverts the changes to Hash.cs from dotnet#31276 and unlinks the file from the
Code Style layer.
  • Loading branch information
sharwell committed Nov 27, 2018
1 parent c2ae0be commit 11b3de8
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
<ItemGroup>
<Compile Include="..\..\..\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs" Link="Formatting\EnumerableExtensions.cs" />
<Compile Include="..\..\..\Compilers\Core\Portable\InternalUtilities\ExceptionUtilities.cs" Link="InternalUtilities\ExceptionUtilities.cs" />
<Compile Include="..\..\..\Compilers\Core\Portable\InternalUtilities\Hash.cs" Link="InternalUtilities\Hash.cs" />
<Compile Include="..\..\..\Compilers\Core\Portable\InternalUtilities\IReadOnlySet.cs" Link="InternalUtilities\IReadOnlySet.cs" />
<Compile Include="..\..\..\Compilers\Core\Portable\InternalUtilities\KeyValuePairUtil.cs" Link="InternalUtilities\KeyValuePairUtil.cs" />
<Compile Include="..\..\..\Compilers\Core\Portable\InternalUtilities\SpecializedCollections.cs" Link="InternalUtilities\SpecializedCollections.cs" />
Expand Down
2 changes: 0 additions & 2 deletions src/Compilers/Core/Portable/InternalUtilities/Hash.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ internal static int GetFNVHashCode(byte[] data)
return hashCode;
}

#if !CODE_STYLE
/// <summary>
/// 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
Expand All @@ -197,7 +196,6 @@ internal static int GetFNVHashCode(ReadOnlySpan<byte> data, out bool isAscii)
isAscii = (asciiMask & 0x80) == 0;
return hashCode;
}
#endif

/// <summary>
/// Compute the FNV-1a hash of a sequence of bytes
Expand Down
2 changes: 1 addition & 1 deletion src/Workspaces/Core/Portable/CodeStyle/CodeStyleOption.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
2 changes: 1 addition & 1 deletion src/Workspaces/Core/Portable/Options/OptionKey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 11b3de8

Please sign in to comment.