mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-04-05 20:55:01 +08:00
Use HashCode.Combine
This commit is contained in:
parent
3eb01a1e0c
commit
c2541b815a
@ -1,5 +1,6 @@
|
||||
namespace UglyToad.PdfPig.Core
|
||||
{
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
/// <summary>
|
||||
@ -44,14 +45,7 @@
|
||||
/// <inheritdoc />
|
||||
public override int GetHashCode()
|
||||
{
|
||||
unchecked
|
||||
{
|
||||
int hash = 59;
|
||||
hash = hash * 97 + ObjectNumber.GetHashCode();
|
||||
hash = hash * 97 + Generation.GetHashCode();
|
||||
|
||||
return hash;
|
||||
}
|
||||
return HashCode.Combine(ObjectNumber, Generation);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -85,7 +85,7 @@
|
||||
/// </summary>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return (Point1, Point2).GetHashCode();
|
||||
return HashCode.Combine(Point1, Point2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
namespace UglyToad.PdfPig.Core
|
||||
{
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
|
||||
@ -97,7 +98,7 @@
|
||||
/// </summary>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return (X, Y).GetHashCode();
|
||||
return HashCode.Combine(X, Y);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -535,7 +535,7 @@
|
||||
/// <inheritdoc />
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return (From, To).GetHashCode();
|
||||
return HashCode.Combine(From, To);
|
||||
}
|
||||
}
|
||||
|
||||
@ -762,7 +762,7 @@
|
||||
/// <inheritdoc />
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return (StartPoint, FirstControlPoint, SecondControlPoint, EndPoint).GetHashCode();
|
||||
return HashCode.Combine(StartPoint, FirstControlPoint, SecondControlPoint, EndPoint);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,11 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition="'$(TargetFramework)'=='net462' OR '$(TargetFramework)'=='net47'">
|
||||
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
|
||||
<PackageReference Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
|
||||
<PackageReference Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\pdfpig.snk" Link="pdfpig.snk" />
|
||||
</ItemGroup>
|
||||
|
Loading…
Reference in New Issue
Block a user