1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 19:22:54 +08:00

Added "getIdFromUrl" call back to content.action because performance impact is small and no unnecessary id calculations are done

This commit is contained in:
FreezyLemon 2017-12-04 13:29:56 +01:00
parent dcdc186a53
commit 319f43e209

View File

@ -107,12 +107,11 @@ namespace osu.Game.Graphics.Sprites
}
url = url.Substring(osuUrlIndex + 11);
var id = getIdFromUrl(url);
if (url.StartsWith("s/") || url.StartsWith("beatmapsets/") || url.StartsWith("d/"))
content.Action = () => beatmapSetOverlay.ShowBeatmapSet(id);
content.Action = () => beatmapSetOverlay.ShowBeatmapSet(getIdFromUrl(url));
else if (url.StartsWith("b/") || url.StartsWith("beatmaps/"))
content.Action = () => beatmapSetOverlay.ShowBeatmap(id);
else if (url.StartsWith("ss/"))
content.Action = () => beatmapSetOverlay.ShowBeatmap(getIdFromUrl(url));
else
content.Action = () => Process.Start($"https://osu.ppy.sh/{url}");
}
else