mirror of
https://github.com/osukey/osukey.git
synced 2025-08-02 14:17:06 +09:00
Remove allocation of string.IndexOf()
This commit is contained in:
@ -69,7 +69,9 @@ namespace osu.Game.Beatmaps.Formats
|
||||
|
||||
protected string StripComments(string line)
|
||||
{
|
||||
var index = line.IndexOf("//", StringComparison.Ordinal);
|
||||
const string comment_prefix = "//";
|
||||
|
||||
var index = line.AsSpan().IndexOf(comment_prefix.AsSpan());
|
||||
if (index > 0)
|
||||
return line.Substring(0, index);
|
||||
return line;
|
||||
|
Reference in New Issue
Block a user