mirror of https://github.com/ppy/osu
Compare by reference in ControlPoint.Equals()
This commit is contained in:
parent
e0c82d11ab
commit
6a26461683
|
@ -52,8 +52,12 @@ public sealed override bool Equals(object? obj)
|
|||
&& 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();
|
||||
|
|
Loading…
Reference in New Issue