From 319f43e209e1d5b872c0e17d5a39b115dd1dbcbc Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Mon, 4 Dec 2017 13:29:56 +0100 Subject: [PATCH] Added "getIdFromUrl" call back to content.action because performance impact is small and no unnecessary id calculations are done --- osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs index 2199800d64..ddce36c77d 100644 --- a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs +++ b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs @@ -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