1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-18 06:27:18 +08:00

Implement equality correctly in Live

This commit is contained in:
Dean Herbert 2022-09-13 19:16:25 +09:00
parent 0fcd9e02f6
commit 9226f0abbc

View File

@ -51,7 +51,13 @@ namespace osu.Game.Database
ID = id;
}
public bool Equals(Live<T>? other) => ID == other?.ID;
public bool Equals(Live<T>? other)
{
if (ReferenceEquals(this, other)) return true;
if (other == null) return false;
return ID == other.ID;
}
public override int GetHashCode() => HashCode.Combine(ID);