Add comment regarding equality check importance in `LegacyHitSampleInfo`

This commit is contained in:
Dean Herbert 2022-03-23 20:18:44 +09:00
parent 997c091a8d
commit c079a9cd32
1 changed files with 3 additions and 0 deletions

View File

@ -500,6 +500,9 @@ public virtual LegacyHitSampleInfo With(Optional<string> newName = default, Opti
=> new LegacyHitSampleInfo(newName.GetOr(Name), newBank.GetOr(Bank), newVolume.GetOr(Volume), newCustomSampleBank.GetOr(CustomSampleBank), newIsLayered.GetOr(IsLayered));
public bool Equals(LegacyHitSampleInfo? other)
// The additions to equality checks here are *required* to ensure that pooling works correctly.
// Of note, `IsLayered` may cause the usage of `SampleVirtual` instead of an actual sample (in cases playback is not required).
// Removing it would cause samples which may actually require playback to potentially source for a `SampleVirtual` sample pool.
=> base.Equals(other) && CustomSampleBank == other.CustomSampleBank && IsLayered == other.IsLayered;
public override bool Equals(object? obj)