mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 15:26:07 +08:00
Fix bad equality comparer implementations
This commit is contained in:
parent
b780fdbe4c
commit
dda4d76d72
@ -66,7 +66,7 @@ namespace osu.Game.Rulesets.Catch.Objects
|
||||
=> other != null;
|
||||
|
||||
public override bool Equals(object obj)
|
||||
=> Equals((BananaHitSampleInfo)obj);
|
||||
=> obj is BananaHitSampleInfo other && Equals(other);
|
||||
|
||||
public override int GetHashCode() => lookup_names.GetHashCode();
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ namespace osu.Game.Audio
|
||||
=> other != null && Name == other.Name && Bank == other.Bank && Suffix == other.Suffix;
|
||||
|
||||
public override bool Equals(object? obj)
|
||||
=> Equals((HitSampleInfo?)obj);
|
||||
=> obj is HitSampleInfo other && Equals(other);
|
||||
|
||||
public override int GetHashCode() => HashCode.Combine(Name, Bank, Suffix);
|
||||
}
|
||||
|
@ -496,7 +496,8 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
||||
public bool Equals(LegacyHitSampleInfo? other)
|
||||
=> base.Equals(other) && CustomSampleBank == other.CustomSampleBank && IsLayered == other.IsLayered;
|
||||
|
||||
public override bool Equals(object? obj) => Equals((LegacyHitSampleInfo?)obj);
|
||||
public override bool Equals(object? obj)
|
||||
=> obj is LegacyHitSampleInfo other && Equals(other);
|
||||
|
||||
public override int GetHashCode() => HashCode.Combine(base.GetHashCode(), CustomSampleBank, IsLayered);
|
||||
}
|
||||
@ -529,7 +530,7 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
||||
=> base.Equals(other) && Filename == other.Filename;
|
||||
|
||||
public override bool Equals(object? obj)
|
||||
=> Equals((FileHitSampleInfo?)obj);
|
||||
=> obj is FileHitSampleInfo other && Equals(other);
|
||||
|
||||
public override int GetHashCode() => HashCode.Combine(base.GetHashCode(), Filename);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user