Browse Source

Replace HashHelpers with HashCode.Combine

pull/783/head
Jason Nelson 8 years ago
parent
commit
77c54662a2
  1. 9
      src/ImageSharp/ColorSpaces/CieLab.cs
  2. 6
      src/ImageSharp/ColorSpaces/CieLch.cs
  3. 9
      src/ImageSharp/ColorSpaces/CieLchuv.cs
  4. 9
      src/ImageSharp/ColorSpaces/CieLuv.cs
  5. 2
      src/ImageSharp/ColorSpaces/CieXyChromaticityCoordinates.cs
  6. 8
      src/ImageSharp/ColorSpaces/CieXyy.cs
  7. 8
      src/ImageSharp/ColorSpaces/CieXyz.cs
  8. 9
      src/ImageSharp/ColorSpaces/Cmyk.cs
  9. 5
      src/ImageSharp/ColorSpaces/Conversion/Implementation/RGBPrimariesChromaticityCoordinates.cs
  10. 6
      src/ImageSharp/ColorSpaces/Conversion/Implementation/WorkingSpaces/GammaWorkingSpace.cs
  11. 4
      src/ImageSharp/ColorSpaces/Conversion/Implementation/WorkingSpaces/RgbWorkingSpaceBase.cs
  12. 8
      src/ImageSharp/ColorSpaces/Hsl.cs
  13. 8
      src/ImageSharp/ColorSpaces/Hsv.cs
  14. 6
      src/ImageSharp/ColorSpaces/HunterLab.cs
  15. 8
      src/ImageSharp/ColorSpaces/LinearRgb.cs
  16. 8
      src/ImageSharp/ColorSpaces/Lms.cs
  17. 8
      src/ImageSharp/ColorSpaces/Rgb.cs
  18. 8
      src/ImageSharp/ColorSpaces/YCbCr.cs
  19. 10
      src/ImageSharp/Formats/Jpeg/Components/Decoder/AdobeMarker.cs
  20. 13
      src/ImageSharp/Formats/Jpeg/Components/Decoder/JFifMarker.cs
  21. 2
      src/ImageSharp/ImageSharp.csproj
  22. 14
      src/ImageSharp/MetaData/ImageProperty.cs
  23. 6
      src/ImageSharp/MetaData/Profiles/Exif/ExifValue.cs
  24. 21
      src/ImageSharp/MetaData/Profiles/ICC/Curves/IccParametricCurve.cs
  25. 8
      src/ImageSharp/MetaData/Profiles/ICC/Curves/IccResponseCurve.cs
  26. 8
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccChromaticityTagDataEntry.cs
  27. 2
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccColorantOrderTagDataEntry.cs
  28. 2
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccColorantTableTagDataEntry.cs
  29. 17
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccCrdInfoTagDataEntry.cs
  30. 5
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccCurveTagDataEntry.cs
  31. 8
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccDataTagDataEntry.cs
  32. 2
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccDateTimeTagDataEntry.cs
  33. 5
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccFix16ArrayTagDataEntry.cs
  34. 12
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLut16TagDataEntry.cs
  35. 12
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLut8TagDataEntry.cs
  36. 18
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLutAToBTagDataEntry.cs
  37. 18
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLutBToATagDataEntry.cs
  38. 14
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccMeasurementTagDataEntry.cs
  39. 5
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccMultiLocalizedUnicodeTagDataEntry.cs
  40. 6
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccMultiProcessElementsTagDataEntry.cs
  41. 14
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccNamedColor2TagDataEntry.cs
  42. 5
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccParametricCurveTagDataEntry.cs
  43. 5
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccProfileSequenceDescTagDataEntry.cs
  44. 5
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccProfileSequenceIdentifierTagDataEntry.cs
  45. 8
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccResponseCurveSet16TagDataEntry.cs
  46. 5
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccScreeningTagDataEntry.cs
  47. 5
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccSignatureTagDataEntry.cs
  48. 14
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccTextDescriptionTagDataEntry.cs
  49. 5
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccTextTagDataEntry.cs
  50. 5
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUFix16ArrayTagDataEntry.cs
  51. 7
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt16ArrayTagDataEntry.cs
  52. 5
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt32ArrayTagDataEntry.cs
  53. 5
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt64ArrayTagDataEntry.cs
  54. 5
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt8ArrayTagDataEntry.cs
  55. 10
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUcrBgTagDataEntry.cs
  56. 5
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUnknownTagDataEntry.cs
  57. 10
      src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccViewingConditionsTagDataEntry.cs
  58. 12
      src/ImageSharp/MetaData/Profiles/ICC/Various/IccClut.cs
  59. 10
      src/ImageSharp/MetaData/Profiles/ICC/Various/IccColorantTableEntry.cs
  60. 8
      src/ImageSharp/MetaData/Profiles/ICC/Various/IccNamedColor.cs
  61. 14
      src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileDescription.cs
  62. 10
      src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileId.cs
  63. 5
      src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileSequenceIdentifier.cs
  64. 12
      src/ImageSharp/MetaData/Profiles/ICC/Various/IccResponseNumber.cs
  65. 5
      src/ImageSharp/MetaData/Profiles/ICC/Various/IccScreeningChannel.cs
  66. 11
      src/ImageSharp/MetaData/Profiles/ICC/Various/IccTagTableEntry.cs
  67. 6
      src/ImageSharp/PixelFormats/PixelImplementations/Bgr24.cs
  68. 6
      src/ImageSharp/PixelFormats/PixelImplementations/Rgb24.cs
  69. 5
      src/ImageSharp/PixelFormats/PixelImplementations/Rgb48.cs
  70. 7
      src/ImageSharp/PixelFormats/PixelImplementations/RgbaVector.cs
  71. 7
      src/ImageSharp/Primitives/ValueSize.cs
  72. 3
      src/ImageSharp/Processing/Processors/Dithering/PixelPair.cs

9
src/ImageSharp/ColorSpaces/CieLab.cs

@ -118,14 +118,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
public static bool operator !=(CieLab left, CieLab right) => !left.Equals(right);
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(
this.L.GetHashCode(),
this.A.GetHashCode(),
this.B.GetHashCode(),
this.WhitePoint.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.L, this.A, this.B, this.WhitePoint);
/// <inheritdoc/>
public override string ToString() => FormattableString.Invariant($"CieLab({this.L:#0.##}, {this.A:#0.##}, {this.B:#0.##})");

6
src/ImageSharp/ColorSpaces/CieLch.cs

@ -122,11 +122,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(
this.L.GetHashCode(),
this.C.GetHashCode(),
this.H.GetHashCode(),
this.WhitePoint.GetHashCode());
return HashCode.Combine(this.L, this.C, this.H, this.WhitePoint);
}
/// <inheritdoc/>

9
src/ImageSharp/ColorSpaces/CieLchuv.cs

@ -119,14 +119,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
public static bool operator !=(CieLchuv left, CieLchuv right) => !left.Equals(right);
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(
this.L.GetHashCode(),
this.C.GetHashCode(),
this.H.GetHashCode(),
this.WhitePoint.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.L, this.C, this.H, this.WhitePoint);
/// <inheritdoc/>
public override string ToString() => FormattableString.Invariant($"CieLchuv({this.L:#0.##}, {this.C:#0.##}, {this.H:#0.##})");

9
src/ImageSharp/ColorSpaces/CieLuv.cs

@ -119,14 +119,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
public static bool operator !=(CieLuv left, CieLuv right) => !left.Equals(right);
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(
this.L.GetHashCode(),
this.U.GetHashCode(),
this.V.GetHashCode(),
this.WhitePoint.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.L, this.U, this.V, this.WhitePoint);
/// <inheritdoc/>
public override string ToString() => FormattableString.Invariant($"CieLuv({this.L:#0.##}, {this.U:#0.##}, {this.V:#0.##})");

2
src/ImageSharp/ColorSpaces/CieXyChromaticityCoordinates.cs

@ -64,7 +64,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <inheritdoc />
[MethodImpl(InliningOptions.ShortMethod)]
public override int GetHashCode() => HashHelpers.Combine(this.X.GetHashCode(), this.Y.GetHashCode());
public override int GetHashCode() => HashCode.Combine(this.X, this.Y);
/// <inheritdoc/>
public override string ToString() => FormattableString.Invariant($"CieXyChromaticityCoordinates({this.X:#0.##}, {this.Y:#0.##})");

8
src/ImageSharp/ColorSpaces/CieXyy.cs

@ -83,13 +83,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
public static bool operator !=(CieXyy left, CieXyy right) => !left.Equals(right);
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(
this.X.GetHashCode(),
this.Y.GetHashCode(),
this.Yl.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.X, this.Y, this.Yl);
/// <inheritdoc/>
public override string ToString() => FormattableString.Invariant($"CieXyy({this.X:#0.##}, {this.Y:#0.##}, {this.Yl:#0.##})");

8
src/ImageSharp/ColorSpaces/CieXyz.cs

@ -86,13 +86,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
public Vector3 ToVector3() => new Vector3(this.X, this.Y, this.Z);
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(
this.X.GetHashCode(),
this.Y.GetHashCode(),
this.Z.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.X, this.Y, this.Z);
/// <inheritdoc/>
public override string ToString() => FormattableString.Invariant($"CieXyz({this.X:#0.##}, {this.Y:#0.##}, {this.Z:#0.##})");

9
src/ImageSharp/ColorSpaces/Cmyk.cs

@ -90,14 +90,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <inheritdoc/>
[MethodImpl(InliningOptions.ShortMethod)]
public override int GetHashCode()
{
return HashHelpers.Combine(
this.C.GetHashCode(),
this.M.GetHashCode(),
this.Y.GetHashCode(),
this.K.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.C, this.M, this.Y, this.K);
/// <inheritdoc/>
public override string ToString() => FormattableString.Invariant($"Cmyk({this.C:#0.##}, {this.M:#0.##}, {this.Y:#0.##}, {this.K:#0.##})");

5
src/ImageSharp/ColorSpaces/Conversion/Implementation/RGBPrimariesChromaticityCoordinates.cs

@ -86,9 +86,6 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation
}
/// <inheritdoc />
public override int GetHashCode()
{
return HashHelpers.Combine(this.R.GetHashCode(), this.G.GetHashCode(), this.B.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.R, this.G, this.B);
}
}

6
src/ImageSharp/ColorSpaces/Conversion/Implementation/WorkingSpaces/GammaWorkingSpace.cs

@ -1,6 +1,7 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using System;
using System.Runtime.CompilerServices;
using SixLabors.ImageSharp.ColorSpaces.Companding;
@ -57,6 +58,9 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation
}
/// <inheritdoc/>
public override int GetHashCode() => HashHelpers.Combine(base.GetHashCode(), this.Gamma.GetHashCode());
public override int GetHashCode() => HashCode.Combine(
this.WhitePoint,
this.ChromaticityCoordinates,
this.Gamma);
}
}

4
src/ImageSharp/ColorSpaces/Conversion/Implementation/WorkingSpaces/RgbWorkingSpaceBase.cs

@ -1,6 +1,8 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using System;
namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation
{
/// <summary>
@ -76,7 +78,7 @@ namespace SixLabors.ImageSharp.ColorSpaces.Conversion.Implementation
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(this.WhitePoint.GetHashCode(), this.ChromaticityCoordinates.GetHashCode());
return HashCode.Combine(this.WhitePoint, this.ChromaticityCoordinates);
}
}
}

8
src/ImageSharp/ColorSpaces/Hsl.cs

@ -84,13 +84,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <inheritdoc/>
[MethodImpl(InliningOptions.ShortMethod)]
public override int GetHashCode()
{
return HashHelpers.Combine(
this.H.GetHashCode(),
this.S.GetHashCode(),
this.L.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.H, this.S, this.L);
/// <inheritdoc/>
public override string ToString() => FormattableString.Invariant($"Hsl({this.H:#0.##}, {this.S:#0.##}, {this.L:#0.##})");

8
src/ImageSharp/ColorSpaces/Hsv.cs

@ -82,13 +82,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <inheritdoc/>
[MethodImpl(InliningOptions.ShortMethod)]
public override int GetHashCode()
{
return HashHelpers.Combine(
this.H.GetHashCode(),
this.S.GetHashCode(),
this.V.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.H, this.S, this.V);
/// <inheritdoc/>
public override string ToString() => FormattableString.Invariant($"Hsv({this.H:#0.##}, {this.S:#0.##}, {this.V:#0.##})");

6
src/ImageSharp/ColorSpaces/HunterLab.cs

@ -119,11 +119,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
[MethodImpl(InliningOptions.ShortMethod)]
public override int GetHashCode()
{
return HashHelpers.Combine(
this.L.GetHashCode(),
this.A.GetHashCode(),
this.B.GetHashCode(),
this.WhitePoint.GetHashCode());
return HashCode.Combine(this.L, this.A, this.B, this.WhitePoint);
}
/// <inheritdoc/>

8
src/ImageSharp/ColorSpaces/LinearRgb.cs

@ -126,13 +126,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <inheritdoc/>
[MethodImpl(InliningOptions.ShortMethod)]
public override int GetHashCode()
{
return HashHelpers.Combine(
this.R.GetHashCode(),
this.G.GetHashCode(),
this.B.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.R, this.G, this.B);
/// <inheritdoc/>
public override string ToString() => FormattableString.Invariant($"LinearRgb({this.R:#0.##}, {this.G:#0.##}, {this.B:#0.##})");

8
src/ImageSharp/ColorSpaces/Lms.cs

@ -87,13 +87,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
public Vector3 ToVector3() => new Vector3(this.L, this.M, this.S);
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(
this.L.GetHashCode(),
this.M.GetHashCode(),
this.S.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.L, this.M, this.S);
/// <inheritdoc/>
public override string ToString() => FormattableString.Invariant($"Lms({this.L:#0.##}, {this.M:#0.##}, {this.S:#0.##})");

8
src/ImageSharp/ColorSpaces/Rgb.cs

@ -147,13 +147,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
public Vector3 ToVector3() => new Vector3(this.R, this.G, this.B);
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(
this.R.GetHashCode(),
this.G.GetHashCode(),
this.B.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.R, this.G, this.B);
/// <inheritdoc/>
public override string ToString() => FormattableString.Invariant($"Rgb({this.R:#0.##}, {this.G:#0.##}, {this.B:#0.##})");

8
src/ImageSharp/ColorSpaces/YCbCr.cs

@ -83,13 +83,7 @@ namespace SixLabors.ImageSharp.ColorSpaces
/// <inheritdoc/>
[MethodImpl(InliningOptions.ShortMethod)]
public override int GetHashCode()
{
return HashHelpers.Combine(
this.Y.GetHashCode(),
this.Cb.GetHashCode(),
this.Cr.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.Y, this.Cb, this.Cr);
/// <inheritdoc/>
public override string ToString() => FormattableString.Invariant($"YCbCr({this.Y}, {this.Cb}, {this.Cr})");

10
src/ImageSharp/Formats/Jpeg/Components/Decoder/AdobeMarker.cs

@ -100,11 +100,11 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(
this.DCTEncodeVersion.GetHashCode(),
this.APP14Flags0.GetHashCode(),
this.APP14Flags1.GetHashCode(),
this.ColorTransform.GetHashCode());
return HashCode.Combine(
this.DCTEncodeVersion,
this.APP14Flags0,
this.APP14Flags1,
this.ColorTransform);
}
}
}

13
src/ImageSharp/Formats/Jpeg/Components/Decoder/JFifMarker.cs

@ -112,13 +112,12 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(
this.MajorVersion.GetHashCode(),
HashHelpers.Combine(
this.MinorVersion.GetHashCode(),
HashHelpers.Combine(
this.DensityUnits.GetHashCode(),
HashHelpers.Combine(this.XDensity, this.YDensity))));
return HashCode.Combine(
this.MajorVersion,
this.MinorVersion,
this.DensityUnits,
this.XDensity,
this.YDensity);
}
}
}

2
src/ImageSharp/ImageSharp.csproj

@ -38,7 +38,7 @@
<ItemGroup>
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="4.5.1" />
<PackageReference Include="SixLabors.Core" Version="1.0.0-dev000089" />
<PackageReference Include="SixLabors.Core" Version="1.0.0-dev000094" />
<AdditionalFiles Include="..\..\stylecop.json" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.0-beta007">
<PrivateAssets>All</PrivateAssets>

14
src/ImageSharp/MetaData/ImageProperty.cs

@ -99,19 +99,7 @@ namespace SixLabors.ImageSharp.MetaData
/// <returns>
/// A 32-bit signed integer that is the hash code for this instance.
/// </returns>
public override int GetHashCode()
{
unchecked
{
int hashCode = this.Name.GetHashCode();
if (this.Value != null)
{
hashCode = HashHelpers.Combine(hashCode, this.Value.GetHashCode());
}
return hashCode;
}
}
public override int GetHashCode() => HashCode.Combine(this.Name, this.Value);
/// <summary>
/// Returns the fully qualified type name of this instance.

6
src/ImageSharp/MetaData/Profiles/Exif/ExifValue.cs

@ -200,11 +200,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Exif
/// <inheritdoc/>
public override int GetHashCode()
{
int hashCode = HashHelpers.Combine(this.Tag.GetHashCode(), this.DataType.GetHashCode());
return this.Value != null
? HashHelpers.Combine(hashCode, this.Value.GetHashCode())
: hashCode;
return HashCode.Combine(this.Tag, this.DataType, this.Value);
}
/// <inheritdoc/>

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

@ -154,18 +154,15 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
/// <inheritdoc/>
public override int GetHashCode()
{
unchecked
{
int hashCode = this.Type.GetHashCode();
hashCode = HashHelpers.Combine(hashCode, this.G.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.A.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.B.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.C.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.D.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.E.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.F.GetHashCode());
return hashCode;
}
return HashCode.Combine(
this.Type,
this.G.GetHashCode(),
this.A.GetHashCode(),
this.B.GetHashCode(),
this.C.GetHashCode(),
this.D.GetHashCode(),
this.E.GetHashCode(),
this.F.GetHashCode());
}
}
}

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

@ -73,10 +73,10 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
/// <inheritdoc />
public override int GetHashCode()
{
return HashHelpers.Combine(
this.CurveType.GetHashCode(),
this.XyzValues.GetHashCode(),
this.ResponseArrays.GetHashCode());
return HashCode.Combine(
this.CurveType,
this.XyzValues,
this.ResponseArrays);
}
private bool EqualsResponseArray(IccResponseCurve other)

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

@ -110,10 +110,10 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(
base.GetHashCode(),
this.ColorantType.GetHashCode(),
this.ChannelValues.GetHashCode());
return HashCode.Combine(
this.Signature,
this.ColorantType,
this.ChannelValues);
}
private static double[][] GetColorantArray(IccColorantEncoding colorantType)

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

@ -70,7 +70,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(base.GetHashCode(), this.ColorantNumber.GetHashCode());
return HashCode.Combine(this.Signature, this.ColorantNumber);
}
}
}

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

@ -72,7 +72,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(base.GetHashCode(), this.ColorantData.GetHashCode());
return HashCode.Combine(this.Signature, this.ColorantData);
}
}
}

17
src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccCrdInfoTagDataEntry.cs

@ -121,16 +121,13 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
/// <inheritdoc/>
public override int GetHashCode()
{
unchecked
{
int hashCode = base.GetHashCode();
hashCode = HashHelpers.Combine(hashCode, this.PostScriptProductName?.GetHashCode() ?? 0);
hashCode = HashHelpers.Combine(hashCode, this.RenderingIntent0Crd?.GetHashCode() ?? 0);
hashCode = HashHelpers.Combine(hashCode, this.RenderingIntent1Crd?.GetHashCode() ?? 0);
hashCode = HashHelpers.Combine(hashCode, this.RenderingIntent2Crd?.GetHashCode() ?? 0);
hashCode = HashHelpers.Combine(hashCode, this.RenderingIntent3Crd?.GetHashCode() ?? 0);
return hashCode;
}
return HashCode.Combine(
this.Signature,
this.PostScriptProductName,
this.RenderingIntent0Crd,
this.RenderingIntent1Crd,
this.RenderingIntent2Crd,
this.RenderingIntent3Crd);
}
}
}

5
src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccCurveTagDataEntry.cs

@ -116,9 +116,6 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
}
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(base.GetHashCode(), this.CurveData.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.Signature, this.CurveData);
}
}

8
src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccDataTagDataEntry.cs

@ -91,10 +91,10 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(
base.GetHashCode(),
this.Data.GetHashCode(),
this.IsAscii.GetHashCode());
return HashCode.Combine(
this.Signature,
this.Data,
this.IsAscii);
}
}
}

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

@ -66,7 +66,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(base.GetHashCode(), this.Value.GetHashCode());
return HashCode.Combine(this.Signature, this.Value);
}
}
}

5
src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccFix16ArrayTagDataEntry.cs

@ -64,9 +64,6 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
}
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(base.GetHashCode(), this.Data.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.Signature, this.Data);
}
}

12
src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLut16TagDataEntry.cs

@ -140,12 +140,12 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
/// <inheritdoc/>
public override int GetHashCode()
{
int hashCode = base.GetHashCode();
hashCode = HashHelpers.Combine(hashCode, this.Matrix.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.InputValues.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.ClutValues.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.OutputValues.GetHashCode());
return hashCode;
return HashCode.Combine(
this.Signature,
this.Matrix,
this.InputValues,
this.ClutValues,
this.OutputValues);
}
private Matrix4x4 CreateMatrix(float[,] matrix)

12
src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLut8TagDataEntry.cs

@ -143,12 +143,12 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
/// <inheritdoc/>
public override int GetHashCode()
{
int hashCode = base.GetHashCode();
hashCode = HashHelpers.Combine(hashCode, this.Matrix.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.InputValues.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.ClutValues.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.OutputValues.GetHashCode());
return hashCode;
return HashCode.Combine(
this.Signature,
this.Matrix,
this.InputValues,
this.ClutValues,
this.OutputValues);
}
private Matrix4x4 CreateMatrix(float[,] matrix)

18
src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLutAToBTagDataEntry.cs

@ -183,16 +183,14 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
/// <inheritdoc/>
public override int GetHashCode()
{
int hashCode = base.GetHashCode();
hashCode = HashHelpers.Combine(hashCode, this.InputChannelCount.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.OutputChannelCount.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.Matrix3x3.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.Matrix3x1.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.ClutValues?.GetHashCode() ?? 0);
hashCode = HashHelpers.Combine(hashCode, this.CurveB?.GetHashCode() ?? 0);
hashCode = HashHelpers.Combine(hashCode, this.CurveM?.GetHashCode() ?? 0);
hashCode = HashHelpers.Combine(hashCode, this.CurveA?.GetHashCode() ?? 0);
return hashCode;
return HashCode.Combine(
this.Signature,
this.InputChannelCount,
this.OutputChannelCount,
this.Matrix3x3,
this.Matrix3x1,
this.ClutValues,
HashCode.Combine(this.CurveB, this.CurveM, this.CurveA));
}
private bool EqualsCurve(IccTagDataEntry[] thisCurves, IccTagDataEntry[] entryCurves)

18
src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccLutBToATagDataEntry.cs

@ -183,16 +183,14 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
/// <inheritdoc/>
public override int GetHashCode()
{
int hashCode = base.GetHashCode();
hashCode = HashHelpers.Combine(hashCode, this.InputChannelCount.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.OutputChannelCount.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.Matrix3x3.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.Matrix3x1.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.ClutValues?.GetHashCode() ?? 0);
hashCode = HashHelpers.Combine(hashCode, this.CurveB?.GetHashCode() ?? 0);
hashCode = HashHelpers.Combine(hashCode, this.CurveM?.GetHashCode() ?? 0);
hashCode = HashHelpers.Combine(hashCode, this.CurveA?.GetHashCode() ?? 0);
return hashCode;
return HashCode.Combine(
this.Signature,
this.InputChannelCount,
this.OutputChannelCount,
this.Matrix3x3,
this.Matrix3x1,
this.ClutValues,
HashCode.Combine(this.CurveB, this.CurveM, this.CurveA));
}
private bool EqualsCurve(IccTagDataEntry[] thisCurves, IccTagDataEntry[] entryCurves)

14
src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccMeasurementTagDataEntry.cs

@ -106,13 +106,13 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
/// <inheritdoc/>
public override int GetHashCode()
{
int hashCode = base.GetHashCode();
hashCode = HashHelpers.Combine(hashCode, this.Observer.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.XyzBacking.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.Geometry.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.Flare.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.Illuminant.GetHashCode());
return hashCode;
return HashCode.Combine(
this.Signature,
this.Observer,
this.XyzBacking,
this.Geometry,
this.Flare,
this.Illuminant);
}
}
}

5
src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccMultiLocalizedUnicodeTagDataEntry.cs

@ -66,9 +66,6 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
}
/// <inheritdoc />
public override int GetHashCode()
{
return HashHelpers.Combine(base.GetHashCode(), this.Texts.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.Signature, this.Texts);
}
}

6
src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccMultiProcessElementsTagDataEntry.cs

@ -90,11 +90,11 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(
base.GetHashCode(),
return HashCode.Combine(
this.Signature,
this.InputChannelCount,
this.OutputChannelCount,
this.Data.GetHashCode());
this.Data);
}
}
}

14
src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccNamedColor2TagDataEntry.cs

@ -155,13 +155,13 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
/// <inheritdoc/>
public override int GetHashCode()
{
int hashCode = base.GetHashCode();
hashCode = HashHelpers.Combine(hashCode, this.CoordinateCount.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.Prefix?.GetHashCode() ?? 0);
hashCode = HashHelpers.Combine(hashCode, this.Suffix?.GetHashCode() ?? 0);
hashCode = HashHelpers.Combine(hashCode, this.VendorFlags.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.Colors.GetHashCode());
return hashCode;
return HashCode.Combine(
this.Signature,
this.CoordinateCount,
this.Prefix,
this.Suffix,
this.VendorFlags,
this.Colors);
}
}
}

5
src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccParametricCurveTagDataEntry.cs

@ -65,9 +65,6 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
}
/// <inheritdoc />
public override int GetHashCode()
{
return HashHelpers.Combine(base.GetHashCode(), this.Curve.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.Signature, this.Curve);
}
}

5
src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccProfileSequenceDescTagDataEntry.cs

@ -67,9 +67,6 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
}
/// <inheritdoc />
public override int GetHashCode()
{
return HashHelpers.Combine(base.GetHashCode(), this.Descriptions.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.Signature, this.Descriptions);
}
}

5
src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccProfileSequenceIdentifierTagDataEntry.cs

@ -65,9 +65,6 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
}
/// <inheritdoc />
public override int GetHashCode()
{
return HashHelpers.Combine(base.GetHashCode(), this.Data.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.Signature, this.Data);
}
}

8
src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccResponseCurveSet16TagDataEntry.cs

@ -83,10 +83,10 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
/// <inheritdoc />
public override int GetHashCode()
{
return HashHelpers.Combine(
base.GetHashCode(),
this.ChannelCount.GetHashCode(),
this.Curves.GetHashCode());
return HashCode.Combine(
this.Signature,
this.ChannelCount,
this.Curves);
}
}
}

5
src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccScreeningTagDataEntry.cs

@ -77,10 +77,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(
base.GetHashCode(),
(int)this.Flags,
this.Channels.GetHashCode());
return HashCode.Combine(this.Signature, this.Flags, this.Channels);
}
}
}

5
src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccSignatureTagDataEntry.cs

@ -65,9 +65,6 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
}
/// <inheritdoc />
public override int GetHashCode()
{
return HashHelpers.Combine(base.GetHashCode(), this.SignatureData.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.Signature, this.SignatureData);
}
}

14
src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccTextDescriptionTagDataEntry.cs

@ -166,13 +166,13 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
/// <inheritdoc />
public override int GetHashCode()
{
int hashCode = base.GetHashCode();
hashCode = HashHelpers.Combine(hashCode, this.Ascii?.GetHashCode() ?? 0);
hashCode = HashHelpers.Combine(hashCode, this.Unicode?.GetHashCode() ?? 0);
hashCode = HashHelpers.Combine(hashCode, this.ScriptCode?.GetHashCode() ?? 0);
hashCode = HashHelpers.Combine(hashCode, this.UnicodeLanguageCode.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.ScriptCodeCode.GetHashCode());
return hashCode;
return HashCode.Combine(
this.Signature,
this.Ascii,
this.Unicode,
this.ScriptCode,
this.UnicodeLanguageCode,
this.ScriptCodeCode);
}
}
}

5
src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccTextTagDataEntry.cs

@ -64,9 +64,6 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
}
/// <inheritdoc />
public override int GetHashCode()
{
return HashHelpers.Combine(base.GetHashCode(), this.Text.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.Signature, this.Text);
}
}

5
src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUFix16ArrayTagDataEntry.cs

@ -64,9 +64,6 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
}
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(base.GetHashCode(), this.Data.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.Signature, this.Data);
}
}

7
src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt16ArrayTagDataEntry.cs

@ -64,9 +64,6 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
}
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(base.GetHashCode(), this.Data.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.Signature, this.Data);
}
}
}

5
src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt32ArrayTagDataEntry.cs

@ -64,9 +64,6 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
}
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(base.GetHashCode(), this.Data.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.Signature, this.Data);
}
}

5
src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt64ArrayTagDataEntry.cs

@ -65,9 +65,6 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
}
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(base.GetHashCode(), this.Data.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.Signature, this.Data);
}
}

5
src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUInt8ArrayTagDataEntry.cs

@ -64,9 +64,6 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
}
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(base.GetHashCode(), this.Data.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.Signature, this.Data);
}
}

10
src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUcrBgTagDataEntry.cs

@ -86,11 +86,11 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(
base.GetHashCode(),
this.UcrCurve.GetHashCode(),
this.BgCurve.GetHashCode(),
this.Description.GetHashCode());
return HashCode.Combine(
this.Signature,
this.UcrCurve,
this.BgCurve,
this.Description);
}
}
}

5
src/ImageSharp/MetaData/Profiles/ICC/TagDataEntries/IccUnknownTagDataEntry.cs

@ -64,9 +64,6 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
}
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(base.GetHashCode(), this.Data.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.Signature, this.Data);
}
}

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

@ -86,11 +86,11 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(
base.GetHashCode(),
this.IlluminantXyz.GetHashCode(),
this.SurroundXyz.GetHashCode(),
this.Illuminant.GetHashCode());
return HashCode.Combine(
this.Signature,
this.IlluminantXyz,
this.SurroundXyz,
this.Illuminant);
}
}
}

12
src/ImageSharp/MetaData/Profiles/ICC/Various/IccClut.cs

@ -142,12 +142,12 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
/// <inheritdoc/>
public override int GetHashCode()
{
int hashCode = this.Values.GetHashCode();
hashCode = HashHelpers.Combine(hashCode, this.DataType.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.InputChannelCount.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.OutputChannelCount.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.GridPointCount.GetHashCode());
return hashCode;
return HashCode.Combine(
this.Values,
this.DataType,
this.InputChannelCount,
this.OutputChannelCount,
this.GridPointCount);
}
private bool EqualsValuesArray(IccClut other)

10
src/ImageSharp/MetaData/Profiles/ICC/Various/IccColorantTableEntry.cs

@ -102,11 +102,11 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(
this.Name.GetHashCode(),
this.Pcs1.GetHashCode(),
this.Pcs2.GetHashCode(),
this.Pcs3.GetHashCode());
return HashCode.Combine(
this.Name,
this.Pcs1,
this.Pcs2,
this.Pcs3);
}
/// <inheritdoc/>

8
src/ImageSharp/MetaData/Profiles/ICC/Various/IccNamedColor.cs

@ -90,10 +90,10 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(
this.Name.GetHashCode(),
this.PcsCoordinates.GetHashCode(),
this.DeviceCoordinates.GetHashCode());
return HashCode.Combine(
this.Name,
this.PcsCoordinates,
this.DeviceCoordinates);
}
/// <inheritdoc/>

14
src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileDescription.cs

@ -84,13 +84,13 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
/// <inheritdoc />
public override int GetHashCode()
{
int hashCode = this.DeviceManufacturer.GetHashCode();
hashCode = HashHelpers.Combine(hashCode, this.DeviceModel.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.DeviceAttributes.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.TechnologyInformation.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.DeviceManufacturerInfo.GetHashCode());
hashCode = HashHelpers.Combine(hashCode, this.DeviceModelInfo.GetHashCode());
return hashCode;
return HashCode.Combine(
this.DeviceManufacturer,
this.DeviceModel,
this.DeviceAttributes,
this.TechnologyInformation,
this.DeviceManufacturerInfo,
this.DeviceModelInfo);
}
}
}

10
src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileId.cs

@ -101,11 +101,11 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(
this.Part1.GetHashCode(),
this.Part2.GetHashCode(),
this.Part3.GetHashCode(),
this.Part4.GetHashCode());
return HashCode.Combine(
this.Part1,
this.Part2,
this.Part3,
this.Part4);
}
/// <inheritdoc/>

5
src/ImageSharp/MetaData/Profiles/ICC/Various/IccProfileSequenceIdentifier.cs

@ -44,9 +44,6 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
}
/// <inheritdoc />
public override int GetHashCode()
{
return HashHelpers.Combine(this.Id.GetHashCode(), this.Description.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.Id, this.Description);
}
}

12
src/ImageSharp/MetaData/Profiles/ICC/Various/IccResponseNumber.cs

@ -73,17 +73,9 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
this.MeasurementValue == other.MeasurementValue;
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(
this.DeviceCode.GetHashCode(),
this.MeasurementValue.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.DeviceCode, this.MeasurementValue);
/// <inheritdoc/>
public override string ToString()
{
return $"Code: {this.DeviceCode}; Value: {this.MeasurementValue}";
}
public override string ToString() => $"Code: {this.DeviceCode}; Value: {this.MeasurementValue}";
}
}

5
src/ImageSharp/MetaData/Profiles/ICC/Various/IccScreeningChannel.cs

@ -85,10 +85,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(
this.Frequency.GetHashCode(),
this.Angle.GetHashCode(),
(int)this.SpotShape);
return HashCode.Combine(this.Frequency, this.Angle, this.SpotShape);
}
/// <inheritdoc/>

11
src/ImageSharp/MetaData/Profiles/ICC/Various/IccTagTableEntry.cs

@ -76,17 +76,14 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc
/// <inheritdoc/>
public bool Equals(IccTagTableEntry other) =>
this.Signature == other.Signature &&
this.Offset == other.Offset &&
this.DataSize == other.DataSize;
this.Signature.Equals(other.Signature) &&
this.Offset.Equals(other.Offset) &&
this.DataSize.Equals(other.DataSize);
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(
this.Signature.GetHashCode(),
this.Offset.GetHashCode(),
this.DataSize.GetHashCode());
return HashCode.Combine(this.Signature, this.Offset, this.DataSize);
}
/// <inheritdoc/>

6
src/ImageSharp/PixelFormats/PixelImplementations/Bgr24.cs

@ -1,6 +1,7 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using System;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
@ -189,9 +190,6 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <inheritdoc/>
[MethodImpl(InliningOptions.ShortMethod)]
public override int GetHashCode()
{
return HashHelpers.Combine(this.R.GetHashCode(), this.B.GetHashCode(), this.G.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.R, this.B, this.G);
}
}

6
src/ImageSharp/PixelFormats/PixelImplementations/Rgb24.cs

@ -1,6 +1,7 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using System;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
@ -200,10 +201,7 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <inheritdoc/>
[MethodImpl(InliningOptions.ShortMethod)]
public override int GetHashCode()
{
return HashHelpers.Combine(this.R.GetHashCode(), this.B.GetHashCode(), this.G.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.R, this.B, this.G);
/// <inheritdoc/>
public override string ToString() => $"Rgb24({this.R}, {this.G}, {this.B})";

5
src/ImageSharp/PixelFormats/PixelImplementations/Rgb48.cs

@ -189,9 +189,6 @@ namespace SixLabors.ImageSharp.PixelFormats
/// <inheritdoc />
[MethodImpl(InliningOptions.ShortMethod)]
public override int GetHashCode()
{
return HashHelpers.Combine(this.R.GetHashCode(), this.G.GetHashCode(), this.B.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.R, this.G, this.B);
}
}

7
src/ImageSharp/PixelFormats/PixelImplementations/RgbaVector.cs

@ -197,11 +197,6 @@ namespace SixLabors.ImageSharp.PixelFormats
}
/// <inheritdoc/>
public override int GetHashCode()
{
int hash = HashHelpers.Combine(this.R.GetHashCode(), this.G.GetHashCode());
hash = HashHelpers.Combine(hash, this.B.GetHashCode());
return HashHelpers.Combine(hash, this.A.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.R, this.G, this.B, this.A);
}
}

7
src/ImageSharp/Primitives/ValueSize.cs

@ -133,9 +133,6 @@ namespace SixLabors.ImageSharp.Primitives
}
/// <inheritdoc/>
public override int GetHashCode()
{
return HashHelpers.Combine(this.Value.GetHashCode(), this.Type.GetHashCode());
}
public override int GetHashCode() => HashCode.Combine(this.Value, this.Type);
}
}
}

3
src/ImageSharp/Processing/Processors/Dithering/PixelPair.cs

@ -43,7 +43,6 @@ namespace SixLabors.ImageSharp.Processing.Processors.Dithering
=> obj is PixelPair<TPixel> other && this.First.Equals(other.First) && this.Second.Equals(other.Second);
/// <inheritdoc/>
public override int GetHashCode()
=> HashHelpers.Combine(this.First.GetHashCode(), this.Second.GetHashCode());
public override int GetHashCode() => HashCode.Combine(this.First, this.Second);
}
}
Loading…
Cancel
Save