1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 03:22:55 +08:00

Compare by char

Co-authored-by: Berkan Diler <berkan.diler1@ingka.ikea.com>
This commit is contained in:
Dan Balasescu 2022-06-13 15:58:11 +09:00 committed by GitHub
parent 776e7c0c71
commit 5a18547342
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -82,13 +82,13 @@ 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(@"[", StringComparison.Ordinal));
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(@"[", StringComparison.Ordinal));
int newSectionEndIndex = Array.FindIndex(result.PiecesNew, newSectionStartIndex + 1, s => s.StartsWith('['));
if (newSectionEndIndex == -1)
newSectionEndIndex = result.PiecesOld.Length;