mirror of
https://github.com/ppy/osu
synced 2024-12-23 23:33:36 +00:00
Fix cache not actually caching anything
This commit is contained in:
parent
a622a0b660
commit
41a2e6eeeb
@ -168,14 +168,14 @@ namespace osu.Game.Configuration
|
||||
}
|
||||
}
|
||||
|
||||
private static readonly ConcurrentDictionary<Type, IEnumerable<(SettingSourceAttribute, PropertyInfo)>> property_info_cache = new ConcurrentDictionary<Type, IEnumerable<(SettingSourceAttribute, PropertyInfo)>>();
|
||||
private static readonly ConcurrentDictionary<Type, (SettingSourceAttribute, PropertyInfo)[]> property_info_cache = new ConcurrentDictionary<Type, (SettingSourceAttribute, PropertyInfo)[]>();
|
||||
|
||||
public static IEnumerable<(SettingSourceAttribute, PropertyInfo)> GetSettingsSourceProperties(this object obj)
|
||||
{
|
||||
var type = obj.GetType();
|
||||
|
||||
if (!property_info_cache.TryGetValue(type, out var properties))
|
||||
property_info_cache[type] = properties = getSettingsSourceProperties(type);
|
||||
property_info_cache[type] = properties = getSettingsSourceProperties(type).ToArray();
|
||||
|
||||
return properties;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user