diff --git a/src/UglyToad.PdfPig.Core/PdfSubpath.cs b/src/UglyToad.PdfPig.Core/PdfSubpath.cs index e2cd4612..d5253258 100644 --- a/src/UglyToad.PdfPig.Core/PdfSubpath.cs +++ b/src/UglyToad.PdfPig.Core/PdfSubpath.cs @@ -8,7 +8,7 @@ /// /// A supbpath is made up of a sequence of connected segments. /// - public class PdfSubpath + public sealed class PdfSubpath { private readonly List commands = new List(); @@ -416,8 +416,10 @@ /// /// Close the current . /// - public class Close : IPathCommand + public sealed class Close : IPathCommand { + private static readonly int _hash = typeof(Close).GetHashCode(); + /// public PdfRectangle? GetBoundingRectangle() { @@ -439,15 +441,14 @@ /// public override int GetHashCode() { - // ReSharper disable once BaseObjectGetHashCodeCallInGetHashCode - return base.GetHashCode(); + return _hash; } } /// /// Move drawing of the current to the specified location. /// - public class Move : IPathCommand + public sealed class Move : IPathCommand { /// /// The location to move to. @@ -497,7 +498,7 @@ /// /// Draw a straight line between two points. /// - public class Line : IPathCommand + public sealed class Line : IPathCommand { /// /// The start of the line.