Skip to content

Commit

Permalink
perf: remove unused property lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed Apr 8, 2021
1 parent 889dd55 commit 8b88c0b
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions src/Uno.UI/UI/Xaml/DependencyProperty.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ private static Dictionary<Type, Dictionary<string, DependencyProperty>> _registr
private readonly static NameToPropertyDictionary _getPropertyCache = new NameToPropertyDictionary();

private readonly static Dictionary<CachedTuple<Type, FrameworkPropertyMetadataOptions>, DependencyProperty[]> _getFrameworkPropertiesForType = new Dictionary<CachedTuple<Type, FrameworkPropertyMetadataOptions>, DependencyProperty[]>(CachedTuple<Type, FrameworkPropertyMetadataOptions>.Comparer);
private readonly static Dictionary<Type, DependencyProperty[]> _getDependencyObjectPropertiesForType = new Dictionary<Type, DependencyProperty[]>(Uno.Core.Comparison.FastTypeComparer.Default);

private readonly PropertyMetadata _ownerTypeMetadata; // For perf consideration, we keep direct ref the metadata for the owner type
private readonly PropertyMetadataDictionary _metadata = new PropertyMetadataDictionary();
Expand Down Expand Up @@ -364,23 +363,6 @@ internal static DependencyProperty[] GetFrameworkPropertiesForType(Type type, Fr
return result;
}

/// <summary>
/// Gets the dependencies properties for the specified type for which the type is a <see cref="DependencyObject"/>.
/// </summary>
/// <param name="type">A dependency object</param>
/// <returns>An array of Dependency Properties.</returns>
internal static DependencyProperty[] GetDependencyObjectPropertiesForType(Type type)
{
DependencyProperty[] result = null;

if (!_getDependencyObjectPropertiesForType.TryGetValue(type, out result))
{
_getDependencyObjectPropertiesForType.Add(type, result = InternalGetDependencyObjectPropertiesForType(type));
}

return result;
}

/// <summary>
/// Clears all the property registrations, when used in unit tests.
/// </summary>
Expand All @@ -390,7 +372,6 @@ internal static void ClearRegistry()
_getPropertiesForType.Clear();
_getPropertyCache.Clear();
_getFrameworkPropertiesForType.Clear();
_getDependencyObjectPropertiesForType.Clear();
}

private static void RegisterProperty(Type ownerType, string name, DependencyProperty newProperty)
Expand Down

0 comments on commit 8b88c0b

Please sign in to comment.