1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 21:02:54 +08:00

chore: correct equal logic

This commit is contained in:
Vlad Frangu 2024-03-16 21:48:44 +02:00
parent 0a6960296e
commit e1c1609271
No known key found for this signature in database
GPG Key ID: C856D3DE86CB4A11

View File

@ -126,7 +126,13 @@ namespace osu.Game.Screens.Select
public T[]? Values;
public bool Equals(OptionalArray<T> other) => Values?.SequenceEqual(other.Values ?? Array.Empty<T>()) ?? false;
public bool Equals(OptionalArray<T> other)
{
if (Values is null && other.Values is null)
return true;
return Values?.SequenceEqual(other.Values ?? Array.Empty<T>()) ?? false;
}
}
public struct OptionalRange<T> : IEquatable<OptionalRange<T>>