From 91c6323be6e6ba357a849f1cdad1ada1e7fcfcb6 Mon Sep 17 00:00:00 2001 From: ema Date: Tue, 16 Dec 2025 19:14:42 +0800 Subject: [PATCH] Refactor null check in OnSpinPropertyChanged Replaces explicit null check and cast with pattern matching for improved readability and conciseness. --- QuickLook/Controls/BusyDecorator/SpinIcon.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/QuickLook/Controls/BusyDecorator/SpinIcon.cs b/QuickLook/Controls/BusyDecorator/SpinIcon.cs index cea93be..c682146 100644 --- a/QuickLook/Controls/BusyDecorator/SpinIcon.cs +++ b/QuickLook/Controls/BusyDecorator/SpinIcon.cs @@ -33,9 +33,7 @@ internal class SpinIcon : TextBlock, ISpinable private static void OnSpinPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { - var b = d as SpinIcon; - - if (b == null) return; + if (d is not SpinIcon b) return; if ((bool)e.NewValue) b.BeginSpin();