mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-15 20:54:58 +00:00
perf: Micro-optimizations
This commit is contained in:
@@ -232,8 +232,10 @@ namespace ICD.Common.Utils
|
||||
|
||||
CacheType(type);
|
||||
|
||||
return s_TypeToAttributesCache.ContainsKey(type)
|
||||
? s_TypeToAttributesCache[type].ToArray()
|
||||
IcdHashSet<Attribute> attributes;
|
||||
|
||||
return s_TypeToAttributesCache.TryGetValue(type, out attributes)
|
||||
? attributes.ToArray(attributes.Count)
|
||||
: Enumerable.Empty<Attribute>();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user