Skip to content

Commit

Permalink
perf: Enable CA1821 (Remove empty finalizers)
Browse files Browse the repository at this point in the history
  • Loading branch information
Youssef1313 committed Sep 5, 2022
1 parent 95f45dc commit 3669fee
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ dotnet_diagnostic.RS0030.severity = error
dotnet_analyzer_diagnostic.category-Performance.severity = none #error - Uncomment when all violations are fixed.

dotnet_diagnostic.CA1805.severity = error
dotnet_diagnostic.CA1821.severity = error
dotnet_diagnostic.CA1061.severity = none
dotnet_diagnostic.CA1802.severity = none
dotnet_diagnostic.CA1014.severity = none
Expand Down Expand Up @@ -326,7 +327,6 @@ dotnet_diagnostic.CA1806.severity = none
dotnet_diagnostic.CA1834.severity = none
dotnet_diagnostic.CA1713.severity = none
dotnet_diagnostic.CA1054.severity = none
dotnet_diagnostic.CA1821.severity = none
dotnet_diagnostic.CA1055.severity = none
dotnet_diagnostic.CA2002.severity = none
dotnet_diagnostic.CA2109.severity = none
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ void Hook(object o, AssemblyLoadEventArgs e)
#endif
}

#if SUPPORTS_LOAD_ASSEMBLIES
~XamlSchemaContext ()
{
#if SUPPORTS_LOAD_ASSEMBLIES
if (reference_assemblies == null)
unhookAssemblyLoad?.Invoke();
#endif
}
#endif

IList<Assembly> reference_assemblies;

Expand Down
6 changes: 3 additions & 3 deletions src/Uno.UI/DirectUI/JoltCollections.h.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ protected IteratorBase()
m_nCurrentIndex = 0;
}

~IteratorBase()
{
//~IteratorBase()
//{
//IsDebuggerPresent(); // TODO UNO
}
//}

protected abstract T GetCurrent();
protected abstract void SetCurrent(T current);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ public RefreshInfoProviderImpl()
//PTR_TRACE_INFO(null, TRACE_MSG_METH, METH_NAME, this);
}

~RefreshInfoProviderImpl()
{
//~RefreshInfoProviderImpl()
//{
//PTR_TRACE_INFO(null, TRACE_MSG_METH, METH_NAME, this);
}
//}

public RefreshInfoProviderImpl(RefreshPullDirection refreshPullDirection, Size refreshVisualizerSize, Compositor compositor)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ private void RatingControl_Unloaded(object sender, RoutedEventArgs e)
RecycleEvents(true /* useSafeGet */);
}

~RatingControl()
{
//~RatingControl()
//{
// We only need to use safe_get in the deruction loop
// We don't need to unload events
// RecycleEvents(true /* useSafeGet */);
}
//}

private float RenderingRatingFontSize()
{
Expand Down
5 changes: 0 additions & 5 deletions src/Uno.UI/UI/Xaml/Controls/NavigationView/NavigationView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ public partial class NavigationView : ContentControl

private SerialDisposable _settingsItemSubscriptions = new SerialDisposable();

~NavigationView()
{

}

void UnhookEventsAndClearFields(bool isFromDestructor = false)
{
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,6 @@ private void NavigationViewItem_Loaded(object sender, RoutedEventArgs e)
}
}

~NavigationViewItem()
{
}

protected override void OnApplyTemplate()
{
// Stop UpdateLocalVisualState before template is applied. Otherwise the visual may not the same as we expect
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ public partial class LoopingSelectorItemAutomationPeer : FrameworkElementAutomat

// private

~LoopingSelectorItemAutomationPeer() { }

//void InitializeImpl(
// LoopingSelectorItem pOwner);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ internal void GetParentNoRef(out LoopingSelector ppValue)
//void OnPointerCaptureLostImpl(PointerRoutedEventArgs e);

// private
~LoopingSelectorItem() { }

//void InitializeImpl();

Expand Down

0 comments on commit 3669fee

Please sign in to comment.