From a7da0fcdf111994f8319b4950196a2a47404c890 Mon Sep 17 00:00:00 2001 From: Jason Nelson Date: Thu, 19 Apr 2018 10:22:13 -0700 Subject: [PATCH] Make IccLut a readonly struct --- .../MetaData/Profiles/ICC/Various/IccLut.cs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccLut.cs b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccLut.cs index 12d3208a7b..c263ffe27b 100644 --- a/src/ImageSharp/MetaData/Profiles/ICC/Various/IccLut.cs +++ b/src/ImageSharp/MetaData/Profiles/ICC/Various/IccLut.cs @@ -9,10 +9,10 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc /// /// Lookup Table /// - internal sealed class IccLut : IEquatable + internal readonly struct IccLut : IEquatable { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the struct. /// /// The LUT values public IccLut(float[] values) @@ -22,7 +22,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the struct. /// /// The LUT values public IccLut(ushort[] values) @@ -39,7 +39,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the struct. /// /// The LUT values public IccLut(byte[] values) @@ -63,12 +63,7 @@ namespace SixLabors.ImageSharp.MetaData.Profiles.Icc /// public bool Equals(IccLut other) { - if (other == null) - { - return false; - } - - if (ReferenceEquals(this, other)) + if (ReferenceEquals(this.Values, other.Values)) { return true; }