mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 20:03:21 +08:00
Fix assertion failures
This commit is contained in:
parent
285e5abb41
commit
a8286bdf04
@ -82,14 +82,18 @@ namespace osu.Game.Screens.Edit
|
||||
|
||||
// Find the index of [HitObject] sections. Lines changed prior to this index are ignored.
|
||||
int oldSectionStartIndex = Array.IndexOf(result.PiecesOld, $"[{section}]");
|
||||
int oldSectionEndIndex = Array.FindIndex(result.PiecesOld, oldSectionStartIndex + 1, s => s.StartsWith('['));
|
||||
if (oldSectionStartIndex == -1)
|
||||
return;
|
||||
|
||||
int oldSectionEndIndex = Array.FindIndex(result.PiecesOld, oldSectionStartIndex + 1, s => s.StartsWith('['));
|
||||
if (oldSectionEndIndex == -1)
|
||||
oldSectionEndIndex = result.PiecesOld.Length;
|
||||
|
||||
int newSectionStartIndex = Array.IndexOf(result.PiecesNew, $"[{section}]");
|
||||
int newSectionEndIndex = Array.FindIndex(result.PiecesNew, newSectionStartIndex + 1, s => s.StartsWith('['));
|
||||
if (newSectionStartIndex == -1)
|
||||
return;
|
||||
|
||||
int newSectionEndIndex = Array.FindIndex(result.PiecesNew, newSectionStartIndex + 1, s => s.StartsWith('['));
|
||||
if (newSectionEndIndex == -1)
|
||||
newSectionEndIndex = result.PiecesNew.Length;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user