1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 00:42:55 +08:00

Compare by reference in ControlPoint.Equals()

This commit is contained in:
Dan Balasescu 2022-06-21 12:05:28 +09:00
parent e0c82d11ab
commit 6a26461683

View File

@ -52,8 +52,12 @@ namespace osu.Game.Beatmaps.ControlPoints
&& Equals(otherControlPoint);
public virtual bool Equals(ControlPoint? other)
=> other != null
&& Time == other.Time;
{
if (ReferenceEquals(other, null)) return false;
if (ReferenceEquals(other, this)) return true;
return Time == other.Time;
}
// ReSharper disable once NonReadonlyMemberInGetHashCode
public override int GetHashCode() => Time.GetHashCode();