From 45168de0289f53cf46524e256fb9b4db71ff3d71 Mon Sep 17 00:00:00 2001 From: Dariusz Komosinski Date: Sat, 9 Nov 2019 14:42:28 +0100 Subject: [PATCH] Remove not needed type check. --- src/Avalonia.Controls/Shapes/Shape.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Avalonia.Controls/Shapes/Shape.cs b/src/Avalonia.Controls/Shapes/Shape.cs index 1e5cdc9744..7728302aad 100644 --- a/src/Avalonia.Controls/Shapes/Shape.cs +++ b/src/Avalonia.Controls/Shapes/Shape.cs @@ -165,9 +165,9 @@ namespace Avalonia.Controls.Shapes { property.Changed.Subscribe(e => { - if (e.Sender is TShape) + if (e.Sender is TShape shape) { - AffectsGeometryInvalidate(e); + AffectsGeometryInvalidate(shape, e); } }); } @@ -318,13 +318,8 @@ namespace Avalonia.Controls.Shapes return (size, transform); } - private static void AffectsGeometryInvalidate(AvaloniaPropertyChangedEventArgs e) + private static void AffectsGeometryInvalidate(Shape control, AvaloniaPropertyChangedEventArgs e) { - if (!(e.Sender is Shape control)) - { - return; - } - // If the geometry is invalidated when Bounds changes, only invalidate when the Size // portion changes. if (e.Property == BoundsProperty)