diff --git a/osu.Game/Skinning/LocalSkinOverrideContainer.cs b/osu.Game/Skinning/LocalSkinOverrideContainer.cs index bab2a956be..ad6a033936 100644 --- a/osu.Game/Skinning/LocalSkinOverrideContainer.cs +++ b/osu.Game/Skinning/LocalSkinOverrideContainer.cs @@ -46,8 +46,7 @@ public SampleChannel GetSample(string sampleName) public TValue? GetValue(Func query) where TConfiguration : SkinConfiguration where TValue : struct { TValue? val = null; - var conf = (source as Skin)?.Configuration as TConfiguration; - if (conf != null) + if ((source as Skin)?.Configuration is TConfiguration conf) val = query?.Invoke(conf); return val ?? fallbackSource?.GetValue(query); @@ -56,8 +55,7 @@ public SampleChannel GetSample(string sampleName) public TValue GetValue(Func query) where TConfiguration : SkinConfiguration where TValue : class { TValue val = null; - var conf = (source as Skin)?.Configuration as TConfiguration; - if (conf != null) + if ((source as Skin)?.Configuration is TConfiguration conf) val = query?.Invoke(conf); return val ?? fallbackSource?.GetValue(query);