OSDN Git Service

パターンマッチングを使用する (IDE0019)
[opentween/open-tween.git] / OpenTween / TweetThumbnail.cs
index 7c372b5..d985d6e 100644 (file)
@@ -243,11 +243,8 @@ namespace OpenTween
 
         private void pictureBox_DoubleClick(object sender, EventArgs e)
         {
-            var thumb = ((PictureBox)sender).Tag as ThumbnailInfo;
-
-            if (thumb == null) return;
-
-            this.OpenImage(thumb);
+            if (((PictureBox)sender).Tag is ThumbnailInfo thumb)
+                this.OpenImage(thumb);
         }
 
         private void contextMenuStrip_Opening(object sender, CancelEventArgs e)