mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 06:42:54 +08:00
Remove allocation of string.IndexOf()
This commit is contained in:
parent
bd99a87298
commit
5b544a0c97
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user