Browse Source

Use GetHashCode when combining int values

af/merge-core
Jason Nelson 8 years ago
parent
commit
a0e6fa45cd
  1. 2
      src/ImageSharp/MetaData/Profiles/ICC/Curves/IccParametricCurve.cs
  2. 2
      src/ImageSharp/MetaData/Profiles/ICC/Curves/IccResponseCurve.cs
  3. 2
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccChromaticityTagDataEntry.cs
  4. 2
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccViewingConditionsTagDataEntry.cs

2
src/ImageSharp/MetaData/Profiles/ICC/Curves/IccParametricCurve.cs

@ -156,7 +156,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
{ {
unchecked unchecked
{ {
int hashCode = (int)this.Type; int hashCode = this.Type.GetHashCode();
hashCode = HashHelpers.Combine(hashCode, this.G.GetHashCode()); hashCode = HashHelpers.Combine(hashCode, this.G.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.A.GetHashCode()); hashCode = HashHelpers.Combine(hashCode, this.A.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.B.GetHashCode()); hashCode = HashHelpers.Combine(hashCode, this.B.GetHashCode());

2
src/ImageSharp/MetaData/Profiles/ICC/Curves/IccResponseCurve.cs

@ -74,7 +74,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
public override int GetHashCode() public override int GetHashCode()
{ {
return HashHelpers.Combine( return HashHelpers.Combine(
(int)this.CurveType, this.CurveType.GetHashCode(),
this.XyzValues.GetHashCode(), this.XyzValues.GetHashCode(),
this.ResponseArrays.GetHashCode()); this.ResponseArrays.GetHashCode());
} }

2
src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccChromaticityTagDataEntry.cs

@ -112,7 +112,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
{ {
return HashHelpers.Combine( return HashHelpers.Combine(
base.GetHashCode(), base.GetHashCode(),
(int)this.ColorantType, this.ColorantType.GetHashCode(),
this.ChannelValues.GetHashCode()); this.ChannelValues.GetHashCode());
} }

2
src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccViewingConditionsTagDataEntry.cs

@ -90,7 +90,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
base.GetHashCode(), base.GetHashCode(),
this.IlluminantXyz.GetHashCode(), this.IlluminantXyz.GetHashCode(),
this.SurroundXyz.GetHashCode(), this.SurroundXyz.GetHashCode(),
(int)this.Illuminant); this.Illuminant.GetHashCode());
} }
} }
} }

Loading…
Cancel
Save