Skip to content
This repository was archived by the owner on Sep 4, 2024. It is now read-only.

Commit 4bd008c

Browse files
authored
Simplify implementation for ImageTagSet equality
1 parent 7b48e86 commit 4bd008c

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

Xwt/Xwt.Drawing/Image.cs

+1-7
Original file line numberDiff line numberDiff line change
@@ -1008,13 +1008,7 @@ public string [] AsArray {
10081008

10091009
public override bool Equals (object obj)
10101010
{
1011-
var other = obj as ImageTagSet;
1012-
if (other == null || tagsArray.Length != other.tagsArray.Length)
1013-
return false;
1014-
for (int n = 0; n < tagsArray.Length; n++)
1015-
if (tagsArray [n] != other.tagsArray [n])
1016-
return false;
1017-
return true;
1011+
return other is ImageTagSet otherSet && tagsArray.SequenceEqual(other.tagsArray);
10181012
}
10191013

10201014
public override int GetHashCode ()

0 commit comments

Comments
 (0)