mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 22:22:55 +08:00
Extract variable to avoid redundant accesses
This commit is contained in:
parent
be08460bea
commit
32df02084d
@ -34,8 +34,9 @@ namespace osu.Game.Users.Drawables
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(LargeTextureStore textures)
|
private void load(LargeTextureStore textures)
|
||||||
{
|
{
|
||||||
if (api != null && user?.AvatarUrl != null)
|
string avatarUrl = user?.AvatarUrl;
|
||||||
Texture = textures.Get(user.AvatarUrl.StartsWith('/') ? $"{api.WebsiteRootUrl}{user.AvatarUrl}" : user.AvatarUrl);
|
if (api != null && avatarUrl != null)
|
||||||
|
Texture = textures.Get(avatarUrl.StartsWith('/') ? $"{api.WebsiteRootUrl}{avatarUrl}" : avatarUrl);
|
||||||
else if (user != null && user.Id > 1)
|
else if (user != null && user.Id > 1)
|
||||||
Texture = textures.Get($@"https://a.ppy.sh/{user.Id}");
|
Texture = textures.Get($@"https://a.ppy.sh/{user.Id}");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user