Skip to content

Commit

Permalink
Make struct read-only (#220)
Browse files Browse the repository at this point in the history
Also address warning about Equals override not matching nullability.
  • Loading branch information
philstopford authored Sep 11, 2022
1 parent 04cc7bb commit 13dc503
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CSharp/Clipper2Lib/Clipper.Engine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public Vertex(Point64 pt, VertexFlags flags, Vertex? prev)
}
};

internal struct LocalMinima
internal readonly struct LocalMinima
{
public readonly Vertex vertex;
public readonly PathType polytype;
Expand All @@ -85,7 +85,7 @@ public LocalMinima(Vertex vertex, PathType polytype, bool isOpen = false)
return !(lm1 == lm2);
}

public override bool Equals(object obj)
public override bool Equals(object? obj)
{
return obj is LocalMinima minima && this == minima;
}
Expand Down

0 comments on commit 13dc503

Please sign in to comment.