mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 08:02:55 +08:00
Fix Message
equality not passing on equal references
This commit is contained in:
parent
7f47be4680
commit
f8e5570e41
@ -59,7 +59,13 @@ namespace osu.Game.Online.Chat
|
||||
return Id.Value.CompareTo(other.Id.Value);
|
||||
}
|
||||
|
||||
public virtual bool Equals(Message other) => Id.HasValue && Id == other?.Id;
|
||||
public virtual bool Equals(Message other)
|
||||
{
|
||||
if (ReferenceEquals(null, other)) return false;
|
||||
if (ReferenceEquals(this, other)) return true;
|
||||
|
||||
return Id.HasValue && Id == other?.Id;
|
||||
}
|
||||
|
||||
// ReSharper disable once ImpureMethodCallOnReadonlyValueField
|
||||
public override int GetHashCode() => Id.GetHashCode();
|
||||
|
Loading…
Reference in New Issue
Block a user