1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 22:07:25 +08:00

Extract Overlaps() logic to accept generic index and length

This commit is contained in:
Susko3 2023-12-01 01:07:23 +01:00
parent 152c7e513e
commit 30bdd2d4c0

View File

@ -364,7 +364,9 @@ namespace osu.Game.Online.Chat
Argument = argument;
}
public bool Overlaps(Link otherLink) => Index < otherLink.Index + otherLink.Length && otherLink.Index < Index + Length;
public bool Overlaps(Link otherLink) => Overlaps(otherLink.Index, otherLink.Length);
public bool Overlaps(int index, int length) => Index < index + length && index < Index + Length;
public int CompareTo(Link? otherLink) => Index > otherLink?.Index ? 1 : -1;
}