Skip to content

Commit

Permalink
Simplify implementation for ImageTagSet equality
Browse files Browse the repository at this point in the history
  • Loading branch information
Therzok committed Feb 20, 2023
1 parent 7b48e86 commit 4bd008c
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions Xwt/Xwt.Drawing/Image.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1008,13 +1008,7 @@ public ImageTagSet (string tags)

public override bool Equals (object obj)
{
var other = obj as ImageTagSet;
if (other == null || tagsArray.Length != other.tagsArray.Length)
return false;
for (int n = 0; n < tagsArray.Length; n++)
if (tagsArray [n] != other.tagsArray [n])
return false;
return true;
return other is ImageTagSet otherSet && tagsArray.SequenceEqual(other.tagsArray);
}

public override int GetHashCode ()
Expand Down

0 comments on commit 4bd008c

Please sign in to comment.