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:
parent
0fcd9e02f6
commit
9226f0abbc
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user