1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-04 04:53:38 +08:00

Implement equality correctly in Live

This commit is contained in:
Dean Herbert
2022-09-13 19:16:25 +09:00
Unverified
parent 0fcd9e02f6
commit 9226f0abbc
+7 -1
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);