未验证 提交 3876b964 编写于 作者: S Sam Harwell 提交者: GitHub

Merge pull request #31404 from sharwell/unlink-hash

Remove the Code Style dependency on Hash.cs
......@@ -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" />
......@@ -57,6 +56,7 @@
<Compile Include="..\..\..\Workspaces\Core\Portable\CodeStyle\CodeStyleHelpers.cs" Link="Options\CodeStyleHelpers.cs" />
<Compile Include="..\..\..\Workspaces\Core\Portable\CodeStyle\CodeStyleOption.cs" Link="Options\CodeStyleOption.cs" />
<Compile Include="..\..\..\Workspaces\Core\Portable\CodeStyle\NotificationOption.cs" Link="Options\NotificationOption.cs" />
<Compile Include="..\..\..\Workspaces\Core\Portable\CodeStyle\UnusedValuePreference.cs" Link="Options\UnusedValuePreference.cs" />
<Compile Include="..\..\..\Workspaces\Core\Portable\Diagnostics\Extensions_SharedWithCodeStyle.cs" Link="Options\Extensions_SharedWithCodeStyle.cs" />
<Compile Include="..\..\..\Workspaces\Core\Portable\Extensions\NotificationOptionExtensions.cs" Link="Options\NotificationOptionExtensions.cs" />
<Compile Include="..\..\..\Workspaces\Core\Portable\Formatting\AbstractSyntaxFormattingService.cs" Link="Formatting\AbstractSyntaxFormattingService.cs" />
......
......@@ -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
......@@ -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
......
......@@ -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());
}
}
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册