Skip to content

Commit 91c6323

Browse files
committed
Refactor null check in OnSpinPropertyChanged
Replaces explicit null check and cast with pattern matching for improved readability and conciseness.
1 parent 97ebb41 commit 91c6323

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

QuickLook/Controls/BusyDecorator/SpinIcon.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ internal class SpinIcon : TextBlock, ISpinable
3333

3434
private static void OnSpinPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
3535
{
36-
var b = d as SpinIcon;
37-
38-
if (b == null) return;
36+
if (d is not SpinIcon b) return;
3937

4038
if ((bool)e.NewValue)
4139
b.BeginSpin();

0 commit comments

Comments
 (0)