Use exact component value equality checks in equality comparisons
(cherry picked from commit 2cddf3de97943844512b2d84aa6be122c6f0d409)
This commit is contained in:
@@ -499,21 +499,19 @@ namespace FlaxEngine
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public bool Equals(ref Rectangle other)
|
||||
{
|
||||
return Location.Equals(ref other.Location) && Size.Equals(ref other.Size);
|
||||
return Location == other.Location && Size == other.Size;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool Equals(Rectangle other)
|
||||
{
|
||||
return Location.Equals(ref other.Location) && Size.Equals(ref other.Size);
|
||||
return Equals(ref other);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (ReferenceEquals(null, obj))
|
||||
return false;
|
||||
return obj is Rectangle && Equals((Rectangle)obj);
|
||||
return obj is Rectangle other && Equals(ref other);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
Reference in New Issue
Block a user