Skip to content

Commit

Permalink
perf: Remove no-longer-used fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Youssef1313 committed Sep 3, 2024
1 parent 8122799 commit fd8f212
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Uno.UI/UI/Xaml/DependencyObjectStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ public DependencyObjectStore(object originalObject, DependencyProperty dataConte
_originalObjectRef = WeakReferencePool.RentWeakReference(this, originalObject);
_originalObjectType = originalObject is AttachedDependencyObject a ? a.Owner.GetType() : originalObject.GetType();

_properties = new DependencyPropertyDetailsCollection(_originalObjectType, _originalObjectRef, dataContextProperty, templatedParentProperty);
_properties = new DependencyPropertyDetailsCollection(_originalObjectRef, dataContextProperty, templatedParentProperty);

_dataContextProperty = dataContextProperty;
_templatedParentProperty = templatedParentProperty;
Expand Down
4 changes: 1 addition & 3 deletions src/Uno.UI/UI/Xaml/DependencyPropertyDetails.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ namespace Microsoft.UI.Xaml
internal class DependencyPropertyDetails : IEnumerable<object?>, IEnumerable, IDisposable
{
private DependencyPropertyValuePrecedences _highestPrecedence = DependencyPropertyValuePrecedences.DefaultValue;
private readonly Type _dependencyObjectType;
private object? _fastLocalValue;
private BindingExpression? _binding;
private object?[]? _stack;
Expand Down Expand Up @@ -73,10 +72,9 @@ public void Dispose()

public DependencyProperty Property { get; }

internal DependencyPropertyDetails(DependencyProperty property, Type dependencyObjectType, bool isTemplatedParentOrDataContext)
internal DependencyPropertyDetails(DependencyProperty property, bool isTemplatedParentOrDataContext)
{
Property = property;
_dependencyObjectType = dependencyObjectType;

GetPropertyInheritanceConfiguration(property, isTemplatedParentOrDataContext, out var hasInherits, out var hasValueInherits, out var hasValueDoesNotInherits);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ internal void SetSourceValue(DependencyPropertyDetails details, object value)

if (this.Log().IsEnabled(Uno.Foundation.Logging.LogLevel.Debug))
{
this.Log().DebugFormat("Set binding value [{0}] from [{1}].", details.Property.Name, _ownerType);
this.Log().DebugFormat("Set binding value [{0}].", details.Property.Name);
}
}

Expand Down
7 changes: 2 additions & 5 deletions src/Uno.UI/UI/Xaml/DependencyPropertyDetailsCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ namespace Microsoft.UI.Xaml
/// </summary>
partial class DependencyPropertyDetailsCollection : IDisposable
{
private readonly Type _ownerType;
private readonly ManagedWeakReference _ownerReference;
private object? _hardOwnerReference;
private readonly DependencyProperty _dataContextProperty;
Expand All @@ -37,10 +36,8 @@ partial class DependencyPropertyDetailsCollection : IDisposable
/// <summary>
/// Creates an instance using the specified DependencyObject <see cref="Type"/>
/// </summary>
/// <param name="ownerType">The owner type</param>
public DependencyPropertyDetailsCollection(Type ownerType, ManagedWeakReference ownerReference, DependencyProperty dataContextProperty, DependencyProperty templatedParentProperty)
public DependencyPropertyDetailsCollection(ManagedWeakReference ownerReference, DependencyProperty dataContextProperty, DependencyProperty templatedParentProperty)
{
_ownerType = ownerType;
_ownerReference = ownerReference;

_dataContextProperty = dataContextProperty;
Expand Down Expand Up @@ -197,7 +194,7 @@ public DependencyPropertyDetails GetPropertyDetails(DependencyProperty property)

if (propertyEntry == null)
{
propertyEntry = new DependencyPropertyDetails(property, _ownerType, property == _dataContextProperty || property == _templatedParentProperty);
propertyEntry = new DependencyPropertyDetails(property, property == _dataContextProperty || property == _templatedParentProperty);
}

return propertyEntry;
Expand Down

0 comments on commit fd8f212

Please sign in to comment.