mirror of https://github.com/ppy/osu
Reuse `AllSources` when looking up on `FindProvider`
This commit is contained in:
parent
b12adc6073
commit
d0cdc07b11
|
@ -236,14 +236,11 @@ public void Save(Skin skin)
|
|||
|
||||
public ISkin FindProvider(Func<ISkin, bool> lookupFunction)
|
||||
{
|
||||
if (lookupFunction(CurrentSkin.Value))
|
||||
return CurrentSkin.Value;
|
||||
|
||||
if (CurrentSkin.Value is LegacySkin && lookupFunction(DefaultLegacySkin))
|
||||
return DefaultLegacySkin;
|
||||
|
||||
if (lookupFunction(DefaultSkin))
|
||||
return DefaultSkin;
|
||||
foreach (var source in AllSources)
|
||||
{
|
||||
if (lookupFunction(source))
|
||||
return source;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue