mirror of
https://github.com/ppy/osu
synced 2025-01-02 20:32:10 +00:00
Avoid doing a config lookup if initial conditional fails
This commit is contained in:
parent
1364de1166
commit
94fee8c31d
@ -74,8 +74,8 @@ namespace osu.Game.Skinning
|
||||
{
|
||||
if (lookup is GlobalSkinColours || lookup is SkinCustomColourLookup)
|
||||
return lookupWithFallback<TLookup, TValue>(lookup, AllowColourLookup);
|
||||
else
|
||||
return lookupWithFallback<TLookup, TValue>(lookup, AllowConfigurationLookup);
|
||||
|
||||
return lookupWithFallback<TLookup, TValue>(lookup, AllowConfigurationLookup);
|
||||
}
|
||||
|
||||
return fallbackSource?.GetConfig<TLookup, TValue>(lookup);
|
||||
@ -83,11 +83,14 @@ namespace osu.Game.Skinning
|
||||
|
||||
private IBindable<TValue> lookupWithFallback<TLookup, TValue>(TLookup lookup, bool canUseSkinLookup)
|
||||
{
|
||||
var bindable = skin.GetConfig<TLookup, TValue>(lookup);
|
||||
if (bindable != null && canUseSkinLookup)
|
||||
return bindable;
|
||||
else
|
||||
return fallbackSource?.GetConfig<TLookup, TValue>(lookup);
|
||||
if (canUseSkinLookup)
|
||||
{
|
||||
var bindable = skin.GetConfig<TLookup, TValue>(lookup);
|
||||
if (bindable != null)
|
||||
return bindable;
|
||||
}
|
||||
|
||||
return fallbackSource?.GetConfig<TLookup, TValue>(lookup);
|
||||
}
|
||||
|
||||
protected virtual void TriggerSourceChanged() => SourceChanged?.Invoke();
|
||||
|
Loading…
Reference in New Issue
Block a user