From 429306aa876ef9bbe24aa16412d366124fd2c72d Mon Sep 17 00:00:00 2001 From: morguldir Date: Mon, 16 Jul 2018 01:54:20 +0200 Subject: [PATCH] Fix casing, use ordinal string comparison when stripping comments --- .../Beatmaps/Formats/LegacyBeatmapDecoder.cs | 16 ++++++++-------- osu.Game/Beatmaps/Formats/LegacyDecoder.cs | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs b/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs index 641cdc4fd6..7664a4cea3 100644 --- a/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs +++ b/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs @@ -62,34 +62,34 @@ namespace osu.Game.Beatmaps.Formats protected override void ParseLine(Beatmap beatmap, Section section, string line) { - var stripped_line = StripComments(line); + var strippedLine = StripComments(line); switch (section) { case Section.General: - handleGeneral(stripped_line); + handleGeneral(strippedLine); return; case Section.Editor: - handleEditor(stripped_line); + handleEditor(strippedLine); return; case Section.Metadata: handleMetadata(line); return; case Section.Difficulty: - handleDifficulty(stripped_line); + handleDifficulty(strippedLine); return; case Section.Events: - handleEvent(stripped_line); + handleEvent(strippedLine); return; case Section.TimingPoints: - handleTimingPoint(stripped_line); + handleTimingPoint(strippedLine); return; case Section.HitObjects: - handleHitObject(stripped_line); + handleHitObject(strippedLine); return; } - base.ParseLine(beatmap, section, stripped_line); + base.ParseLine(beatmap, section, strippedLine); } private void handleGeneral(string line) diff --git a/osu.Game/Beatmaps/Formats/LegacyDecoder.cs b/osu.Game/Beatmaps/Formats/LegacyDecoder.cs index 7ceb78c30d..0698954bb6 100644 --- a/osu.Game/Beatmaps/Formats/LegacyDecoder.cs +++ b/osu.Game/Beatmaps/Formats/LegacyDecoder.cs @@ -68,7 +68,7 @@ namespace osu.Game.Beatmaps.Formats } internal string StripComments(string line) { - var index = line.IndexOf("//"); + var index = line.IndexOf("//", StringComparison.Ordinal); if (index > 0) return line.Substring(0, index); return line;