File tree 4 files changed +2
-14
lines changed
4 files changed +2
-14
lines changed Original file line number Diff line number Diff line change 233
233
System.Diagnostics.PerformanceCounter;
234
234
System.DirectoryServices;
235
235
System.Formats.Nrbf;
236
- System.IO.Hashing;
237
236
System.IO.Packaging;
238
237
System.Resources.Extensions;
239
238
System.Security.Cryptography.Pkcs;
Original file line number Diff line number Diff line change 9
9
</ItemGroup >
10
10
11
11
<ItemGroup >
12
- <ProjectReference Include =" $(LibrariesProjectRoot)System.IO.Hashing\ref\System.IO.Hashing.csproj" />
13
12
<ProjectReference Include =" $(LibrariesProjectRoot)System.Reflection.Metadata\ref\System.Reflection.Metadata.csproj" />
14
13
</ItemGroup >
15
14
Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ System.Formats.Nrbf.NrbfDecoder</PackageDescription>
17
17
<DisablePackageBaselineValidation >true</DisablePackageBaselineValidation >
18
18
</PropertyGroup >
19
19
<ItemGroup >
20
- <ProjectReference Include =" $(LibrariesProjectRoot)\System.IO.Hashing\src\System.IO.Hashing.csproj" />
21
20
<ProjectReference Include =" $(LibrariesProjectRoot)\System.Reflection.Metadata\src\System.Reflection.Metadata.csproj" />
22
21
</ItemGroup >
23
22
<ItemGroup Condition =" '$(TargetFrameworkIdentifier)' == '.NETFramework'" >
@@ -26,5 +25,6 @@ System.Formats.Nrbf.NrbfDecoder</PackageDescription>
26
25
<ItemGroup Condition =" '$(TargetFrameworkIdentifier)' != '.NETCoreApp'" >
27
26
<Compile Include =" $(CoreLibSharedDir)System\Diagnostics\CodeAnalysis\RequiresDynamicCodeAttribute.cs"
28
27
Link =" System\Diagnostics\CodeAnalysis\RequiresDynamicCodeAttribute.cs" />
28
+ <PackageReference Include =" Microsoft.Bcl.HashCode" Version =" $(MicrosoftBclHashCodeVersion)" />
29
29
</ItemGroup >
30
30
</Project >
Original file line number Diff line number Diff line change 5
5
using System . Collections . Generic ;
6
6
using System . Formats . Nrbf . Utils ;
7
7
using System . IO ;
8
- using System . IO . Hashing ;
9
8
using System . Linq ;
10
9
using System . Runtime . InteropServices ;
11
10
using System . Text ;
@@ -45,14 +44,5 @@ internal static SerializationRecordId Decode(BinaryReader reader)
45
44
public override bool Equals ( object ? obj ) => obj is SerializationRecordId other && Equals ( other ) ;
46
45
47
46
/// <inheritdoc />
48
- public override int GetHashCode ( )
49
- {
50
- int id = _id ;
51
- #if NET
52
- Span < int > integers = new ( ref id ) ;
53
- #else
54
- Span < int > integers = stackalloc int [ 1 ] { id } ;
55
- #endif
56
- return ( int ) XxHash32 . HashToUInt32 ( MemoryMarshal . AsBytes ( integers ) ) ;
57
- }
47
+ public override int GetHashCode ( ) => HashCode . Combine ( _id ) ;
58
48
}
You can’t perform that action at this time.
0 commit comments