mirror of
https://github.com/osukey/osukey.git
synced 2025-08-06 08:03:52 +09:00
Fix casing, use ordinal string comparison when stripping comments
This commit is contained in:
@ -62,34 +62,34 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
|
|
||||||
protected override void ParseLine(Beatmap beatmap, Section section, string line)
|
protected override void ParseLine(Beatmap beatmap, Section section, string line)
|
||||||
{
|
{
|
||||||
var stripped_line = StripComments(line);
|
var strippedLine = StripComments(line);
|
||||||
|
|
||||||
switch (section)
|
switch (section)
|
||||||
{
|
{
|
||||||
case Section.General:
|
case Section.General:
|
||||||
handleGeneral(stripped_line);
|
handleGeneral(strippedLine);
|
||||||
return;
|
return;
|
||||||
case Section.Editor:
|
case Section.Editor:
|
||||||
handleEditor(stripped_line);
|
handleEditor(strippedLine);
|
||||||
return;
|
return;
|
||||||
case Section.Metadata:
|
case Section.Metadata:
|
||||||
handleMetadata(line);
|
handleMetadata(line);
|
||||||
return;
|
return;
|
||||||
case Section.Difficulty:
|
case Section.Difficulty:
|
||||||
handleDifficulty(stripped_line);
|
handleDifficulty(strippedLine);
|
||||||
return;
|
return;
|
||||||
case Section.Events:
|
case Section.Events:
|
||||||
handleEvent(stripped_line);
|
handleEvent(strippedLine);
|
||||||
return;
|
return;
|
||||||
case Section.TimingPoints:
|
case Section.TimingPoints:
|
||||||
handleTimingPoint(stripped_line);
|
handleTimingPoint(strippedLine);
|
||||||
return;
|
return;
|
||||||
case Section.HitObjects:
|
case Section.HitObjects:
|
||||||
handleHitObject(stripped_line);
|
handleHitObject(strippedLine);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
base.ParseLine(beatmap, section, stripped_line);
|
base.ParseLine(beatmap, section, strippedLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleGeneral(string line)
|
private void handleGeneral(string line)
|
||||||
|
@ -68,7 +68,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
}
|
}
|
||||||
internal string StripComments(string line)
|
internal string StripComments(string line)
|
||||||
{
|
{
|
||||||
var index = line.IndexOf("//");
|
var index = line.IndexOf("//", StringComparison.Ordinal);
|
||||||
if (index > 0)
|
if (index > 0)
|
||||||
return line.Substring(0, index);
|
return line.Substring(0, index);
|
||||||
return line;
|
return line;
|
||||||
|
Reference in New Issue
Block a user