Skip to content
This repository was archived by the owner on Mar 30, 2019. It is now read-only.

Commit 0fe1315

Browse files
author
AndrewSt
committed
Improve Equals Size2, SizeF
1 parent 378f529 commit 0fe1315

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

Source/SharpDX/Size2.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ public bool Equals(Size2 other)
7575
/// <inheritdoc/>
7676
public override bool Equals(object obj)
7777
{
78-
if (ReferenceEquals(null, obj)) return false;
79-
if (obj.GetType() != typeof(Size2)) return false;
78+
if (!(obj is Size2))
79+
return false;
80+
8081
return Equals((Size2)obj);
8182
}
8283

Source/SharpDX/Size2F.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ public bool Equals(Size2F other)
7575
/// <inheritdoc/>
7676
public override bool Equals(object obj)
7777
{
78-
if (ReferenceEquals(null, obj)) return false;
79-
if (obj.GetType() != typeof(Size2F)) return false;
78+
if (!(obj is Size2F))
79+
return false;
80+
8081
return Equals((Size2F)obj);
8182
}
8283

0 commit comments

Comments
 (0)