OSDN Git Service

out引数に使用する変数をインライン化する (IDE0018)
authorKimura Youichi <kim.upsilon@bucyou.net>
Tue, 29 May 2018 01:27:45 +0000 (10:27 +0900)
committerKimura Youichi <kim.upsilon@bucyou.net>
Tue, 29 May 2018 01:29:19 +0000 (10:29 +0900)
OpenTween/Tween.cs
OpenTween/TweetDetailsView.cs

index 98da378..435c757 100644 (file)
@@ -2146,9 +2146,7 @@ namespace OpenTween
             }
             else
             {
-                long[] autoPopulatedUserIds;
-                string attachmentUrl;
-                status.Text = this.FormatStatusTextExtended(this.StatusText.Text, out autoPopulatedUserIds, out attachmentUrl);
+                status.Text = this.FormatStatusTextExtended(this.StatusText.Text, out var autoPopulatedUserIds, out var attachmentUrl);
                 status.InReplyToStatusId = this.inReplyTo?.Item1;
 
                 status.AttachmentUrl = attachmentUrl;
@@ -2178,9 +2176,8 @@ namespace OpenTween
             IMediaItem[] uploadItems = null;
             if (ImageSelector.Visible)
             {
-                string serviceName;
                 //画像投稿
-                if (!ImageSelector.TryGetSelectedMedia(out serviceName, out uploadItems))
+                if (!ImageSelector.TryGetSelectedMedia(out var serviceName, out uploadItems))
                     return;
 
                 uploadService = this.ImageSelector.GetService(serviceName);
@@ -4605,12 +4602,7 @@ namespace OpenTween
         }
 
         private string FormatStatusTextExtended(string statusText)
-        {
-            long[] autoPopulatedUserIds;
-            string attachmentUrl;
-
-            return this.FormatStatusTextExtended(statusText, out autoPopulatedUserIds, out attachmentUrl);
-        }
+            => this.FormatStatusTextExtended(statusText, out var autoPopulatedUserIds, out var attachmentUrl);
 
         /// <summary>
         /// <see cref="FormatStatusText"/> に加えて、拡張モードで140字にカウントされない文字列の除去を行います
index 06aff26..41e92fa 100644 (file)
@@ -473,8 +473,7 @@ namespace OpenTween
 
         private async void PostBrowser_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
         {
-            Task asyncTask;
-            bool KeyRes = this.Owner.CommonKeyDown(e.KeyData, FocusedControl.PostBrowser, out asyncTask);
+            var KeyRes = this.Owner.CommonKeyDown(e.KeyData, FocusedControl.PostBrowser, out var asyncTask);
             if (KeyRes)
             {
                 e.IsInputKey = true;