OSDN Git Service

式形式のメソッドを使用する (IDE0021, IDE0022, IDE0025, IDE0053)
authorKimura Youichi <kim.upsilon@bucyou.net>
Wed, 28 Aug 2019 16:59:06 +0000 (01:59 +0900)
committerKimura Youichi <kim.upsilon@bucyou.net>
Wed, 28 Aug 2019 19:26:36 +0000 (04:26 +0900)
36 files changed:
OpenTween.Tests/AnyOrderComparer.cs
OpenTween.Tests/Api/TwitterApiTest.cs
OpenTween.Tests/BingTest.cs
OpenTween.Tests/Connection/LazyJsonTest.cs
OpenTween.Tests/Connection/TwitterApiConnectionTest.cs
OpenTween.Tests/HttpMessageHandlerMock.cs
OpenTween.Tests/LRUCacheDictionaryTest.cs
OpenTween.Tests/MediaSelectorTest.cs
OpenTween.Tests/Models/PostClassTest.cs
OpenTween.Tests/Models/PostFilterRuleTest.cs
OpenTween.Tests/Models/TabModelTest.cs
OpenTween.Tests/MyCommonTest.cs
OpenTween.Tests/OTBaseFormTest.cs
OpenTween.Tests/ShortUrlTest.cs
OpenTween.Tests/TestUtils.cs
OpenTween.Tests/Thumbnail/Services/ImgAzyobuziNetTest.cs
OpenTween.Tests/Thumbnail/Services/MetaThumbnailServiceTest.cs
OpenTween.Tests/Thumbnail/Services/TinamiTest.cs
OpenTween.Tests/TweetThumbnailTest.cs
OpenTween.Tests/TwitterTest.cs
OpenTween/Api/DataModel/GeoJson.cs
OpenTween/Api/DataModel/TwitterConfiguration.cs
OpenTween/Api/DataModel/TwitterError.cs
OpenTween/Api/DataModel/TwitterFriendship.cs
OpenTween/Api/DataModel/TwitterList.cs
OpenTween/Api/DataModel/TwitterPageable.cs
OpenTween/Api/DataModel/TwitterRateLimits.cs
OpenTween/Api/DataModel/TwitterSearchResult.cs
OpenTween/Api/DataModel/TwitterStatus.cs
OpenTween/Api/DataModel/TwitterStreamEvent.cs
OpenTween/Api/DataModel/TwitterTextConfiguration.cs
OpenTween/Api/DataModel/TwitterUser.cs
OpenTween/Models/PostFilterRule.cs
OpenTween/Setting/SettingLocal.cs
OpenTween/Thumbnail/ThumbnailInfo.cs
OpenTween/Tween.cs

index 85134ba..1aa5f8b 100644 (file)
@@ -51,8 +51,6 @@ namespace OpenTween
         }
 
         public int GetHashCode(IEnumerable<T> obj)
-        {
-            throw new NotImplementedException();
-        }
+            => throw new NotImplementedException();
     }
 }
index 40f9f8e..1e68b62 100644 (file)
@@ -38,9 +38,7 @@ namespace OpenTween.Api
     public class TwitterApiTest
     {
         public TwitterApiTest()
-        {
-            this.MyCommonSetup();
-        }
+            => this.MyCommonSetup();
 
         private void MyCommonSetup()
         {
index 8cff6c3..cb1aa92 100644 (file)
@@ -41,17 +41,13 @@ namespace OpenTween
         [InlineData("sq", 1)]
         [InlineData("ja", 67)]
         public void GetLanguageEnumFromIndex_Test(string expected, int index)
-        {
-            Assert.Equal(expected, Bing.GetLanguageEnumFromIndex(index));
-        }
+            => Assert.Equal(expected, Bing.GetLanguageEnumFromIndex(index));
 
         [Theory]
         [InlineData(0, "af")]
         [InlineData(1, "sq")]
         [InlineData(67, "ja")]
         public void GetIndexFromLanguageEnum_Test(int expected, string lang)
-        {
-            Assert.Equal(expected, Bing.GetIndexFromLanguageEnum(lang));
-        }
+            => Assert.Equal(expected, Bing.GetIndexFromLanguageEnum(lang));
     }
 }
index 759255d..bb30d1c 100644 (file)
@@ -115,29 +115,19 @@ namespace OpenTween.Connection
             }
 
             public override void Flush()
-            {
-                throw new NotSupportedException();
-            }
+                => throw new NotSupportedException();
 
             public override int Read(byte[] buffer, int offset, int count)
-            {
-                throw new IOException();
-            }
+                => throw new IOException();
 
             public override long Seek(long offset, SeekOrigin origin)
-            {
-                throw new NotSupportedException();
-            }
+                => throw new NotSupportedException();
 
             public override void SetLength(long value)
-            {
-                throw new NotSupportedException();
-            }
+                => throw new NotSupportedException();
 
             public override void Write(byte[] buffer, int offset, int count)
-            {
-                throw new NotSupportedException();
-            }
+                => throw new NotSupportedException();
 
             protected override void Dispose(bool disposing)
             {
index 11d2623..6fbff58 100644 (file)
@@ -41,9 +41,7 @@ namespace OpenTween.Connection
     public class TwitterApiConnectionTest
     {
         public TwitterApiConnectionTest()
-        {
-            this.MyCommonSetup();
-        }
+            => this.MyCommonSetup();
 
         private void MyCommonSetup()
         {
index c3a6636..feb8ae5 100644 (file)
@@ -35,19 +35,13 @@ namespace OpenTween
             new Queue<Func<HttpRequestMessage, Task<HttpResponseMessage>>>();
 
         public int QueueCount
-        {
-            get { return this.Queue.Count; }
-        }
+            => this.Queue.Count;
 
         public void Enqueue(Func<HttpRequestMessage, Task<HttpResponseMessage>> handler)
-        {
-            this.Queue.Enqueue(handler);
-        }
+            => this.Queue.Enqueue(handler);
 
         public void Enqueue(Func<HttpRequestMessage, HttpResponseMessage> handler)
-        {
-            this.Queue.Enqueue(x => Task.Run(() => handler(x)));
-        }
+            => this.Queue.Enqueue(x => Task.Run(() => handler(x)));
 
         protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
         {
index 8582107..7bfa148 100644 (file)
@@ -163,10 +163,7 @@ namespace OpenTween
 
             // イベント設定
             var removedList = new List<string>();
-            dict.CacheRemoved += (s, e) =>
-            {
-                removedList.Add(e.Item.Key);
-            };
+            dict.CacheRemoved += (s, e) => removedList.Add(e.Item.Key);
 
             // 2 個までに縮小
             dict.TrimLimit = 2;
index 20ed633..91b9361 100644 (file)
@@ -17,9 +17,7 @@ namespace OpenTween
     public class MediaSelectorTest
     {
         public MediaSelectorTest()
-        {
-            this.MyCommonSetup();
-        }
+            => this.MyCommonSetup();
 
         private void MyCommonSetup()
         {
index 94867c5..ca42caf 100644 (file)
@@ -84,9 +84,7 @@ namespace OpenTween.Models
         [InlineData(2L, true)]
         [InlineData(3L, true)]
         public void GetIsFavTest(long statusId, bool expected)
-        {
-            Assert.Equal(expected, PostClassTest.TestCases[statusId].IsFav);
-        }
+            => Assert.Equal(expected, PostClassTest.TestCases[statusId].IsFav);
 
         [Theory]
         [InlineData(2L, true)]
index a960077..a406012 100644 (file)
@@ -31,9 +31,7 @@ namespace OpenTween.Models
     public class PostFilterRuleTest
     {
         public PostFilterRuleTest()
-        {
-            PostFilterRule.AutoCompile = true;
-        }
+            => PostFilterRule.AutoCompile = true;
 
         [Fact]
         public void EmptyRuleTest()
index 362fd2e..bf865fb 100644 (file)
@@ -682,9 +682,7 @@ namespace OpenTween.Models
         [InlineData(MyCommon.TabUsageType.PublicSearch,  false)]
         [InlineData(MyCommon.TabUsageType.Related,       false)]
         public void IsDefault_Test(MyCommon.TabUsageType tabType, bool expected)
-        {
-            Assert.Equal(expected, tabType.IsDefault());
-        }
+            => Assert.Equal(expected, tabType.IsDefault());
 
         [Theory]
         [InlineData(MyCommon.TabUsageType.Home,          false)]
@@ -697,9 +695,7 @@ namespace OpenTween.Models
         [InlineData(MyCommon.TabUsageType.PublicSearch,  false)]
         [InlineData(MyCommon.TabUsageType.Related,       false)]
         public void IsDistributable_Test(MyCommon.TabUsageType tabType, bool expected)
-        {
-            Assert.Equal(expected, tabType.IsDistributable());
-        }
+            => Assert.Equal(expected, tabType.IsDistributable());
 
         [Theory]
         [InlineData(MyCommon.TabUsageType.Home,          false)]
@@ -712,8 +708,6 @@ namespace OpenTween.Models
         [InlineData(MyCommon.TabUsageType.PublicSearch,  true)]
         [InlineData(MyCommon.TabUsageType.Related,       true)]
         public void IsInnerStorage_Test(MyCommon.TabUsageType tabType, bool expected)
-        {
-            Assert.Equal(expected, tabType.IsInnerStorage());
-        }
+            => Assert.Equal(expected, tabType.IsInnerStorage());
     }
 }
index 4194662..a71ff5a 100644 (file)
@@ -42,18 +42,14 @@ namespace OpenTween
         [InlineData("http://日本語.idn.icann.org/", "http://xn--wgv71a119e.idn.icann.org/")]
         [InlineData("http://例え.テスト/", "http://xn--r8jz45g.xn--zckzah/")]
         public void IDNEncodeTest(string uri, string expected)
-        {
-            Assert.Equal(expected, MyCommon.IDNEncode(uri));
-        }
+            => Assert.Equal(expected, MyCommon.IDNEncode(uri));
 
         [Theory]
         [InlineData("http://xn--wgv71a119e.idn.icann.org/", "http://日本語.idn.icann.org/")]
         [InlineData("http://xn--r8jz45g.xn--zckzah/", "http://例え.テスト/")]
         [InlineData("http://xn--a/", "http://xn--a/")] // 不正なpunycode
         public void IDNDecodeTest(string uri, string expected)
-        {
-            Assert.Equal(expected, MyCommon.IDNDecode(uri));
-        }
+            => Assert.Equal(expected, MyCommon.IDNDecode(uri));
 
         [Theory]
         [InlineData("http://xn--r8jz45g.xn--zckzah/", "http://例え.テスト/")]
@@ -65,9 +61,7 @@ namespace OpenTween
         [InlineData("http://example.com/%E3%81%82%FF", "http://example.com/あ%FF")] // 不正なUTF-8シーケンス
         [InlineData("http://example.com/%E3%81%82%ED%A0%80", "http://example.com/あ%ED%A0%80")] // 不正なUTF-8シーケンス (high surrogate)
         public void ConvertToReadableUrl(string url, string expected)
-        {
-            Assert.Equal(expected, MyCommon.ConvertToReadableUrl(url));
-        }
+            => Assert.Equal(expected, MyCommon.ConvertToReadableUrl(url));
 
         [Theory]
         [InlineData(new int[] { 1, 2, 3, 4 }, 0, 3, new int[] { 2, 3, 4, 1 })] // 左ローテイト?
@@ -101,18 +95,14 @@ namespace OpenTween
         [InlineData(new byte[] { 0x01, 0x02 }, 2, new byte[] { 0x01, 0x02 })]
         [InlineData(new byte[] { 0x01, 0x02 }, 1, new byte[] { 0x03 })]
         public void ResizeBytesArrayTest(byte[] bytes, int size, byte[] expected)
-        {
-            Assert.Equal(expected, MyCommon.ResizeBytesArray(bytes, size));
-        }
+            => Assert.Equal(expected, MyCommon.ResizeBytesArray(bytes, size));
 
         [Theory]
         [InlineData("Resources/re.gif", true)]
         [InlineData("Resources/re1.gif", false)]
         [InlineData("Resources/re1.png", false)]
         public void IsAnimatedGifTest(string filename, bool expected)
-        {
-            Assert.Equal(expected, MyCommon.IsAnimatedGif(filename));
-        }
+            => Assert.Equal(expected, MyCommon.IsAnimatedGif(filename));
 
         public static readonly TheoryData<string, DateTimeUtc> DateTimeParse_TestCase = new TheoryData<string, DateTimeUtc>
         {
@@ -145,9 +135,7 @@ namespace OpenTween
         [Theory]
         [MemberData(nameof(CreateDataFromJson_TestCase))]
         public void CreateDataFromJsonTest<T>(string json, T expected)
-        {
-            Assert.Equal(expected, MyCommon.CreateDataFromJson<T>(json));
-        }
+            => Assert.Equal(expected, MyCommon.CreateDataFromJson<T>(json));
 
         [Theory]
         [InlineData("hoge123@example.com", true)]
@@ -157,9 +145,7 @@ namespace OpenTween
         [InlineData("foobar.@example.com", false)]
         [InlineData("foo+bar@example.com", true)]
         public void IsValidEmailTest(string email, bool expected)
-        {
-            Assert.Equal(expected, MyCommon.IsValidEmail(email));
-        }
+            => Assert.Equal(expected, MyCommon.IsValidEmail(email));
 
         [Theory]
         [InlineData(Keys.Shift, new[] { Keys.Shift }, true)]
@@ -169,9 +155,7 @@ namespace OpenTween
         [InlineData(Keys.Control | Keys.Alt, new[] { Keys.Control, Keys.Alt }, true)]
         [InlineData(Keys.Control | Keys.Alt, new[] { Keys.Shift }, false)]
         public void IsKeyDownTest(Keys modifierKeys, Keys[] checkKeys, bool expected)
-        {
-            Assert.Equal(expected, MyCommon._IsKeyDown(modifierKeys, checkKeys));
-        }
+            => Assert.Equal(expected, MyCommon._IsKeyDown(modifierKeys, checkKeys));
 
         [Fact]
         public void GetAssemblyNameTest()
@@ -188,9 +172,7 @@ namespace OpenTween
         [InlineData("%AppName%", "OpenTween")]
         [InlineData("%AppName% %AppName%", "OpenTween OpenTween")]
         public void ReplaceAppNameTest(string str, string excepted)
-        {
-            Assert.Equal(excepted, MyCommon.ReplaceAppName(str, "OpenTween"));
-        }
+            => Assert.Equal(excepted, MyCommon.ReplaceAppName(str, "OpenTween"));
 
         [Theory]
         [InlineData("1.0.0.0", "1.0.0")]
@@ -201,9 +183,7 @@ namespace OpenTween
         [InlineData("1.1.0.0", "1.1.0")]
         [InlineData("1.9.9.1", "1.9.10-dev")]
         public void GetReadableVersionTest(string fileVersion, string expected)
-        {
-            Assert.Equal(expected, MyCommon.GetReadableVersion(fileVersion));
-        }
+            => Assert.Equal(expected, MyCommon.GetReadableVersion(fileVersion));
 
         public static IEnumerable<object[]> GetStatusUrlTest1_TestCase
         {
@@ -223,17 +203,13 @@ namespace OpenTween
         [Theory]
         [MemberData(nameof(GetStatusUrlTest1_TestCase))]
         public void GetStatusUrlTest1(PostClass post, string expected)
-        {
-            Assert.Equal(expected, MyCommon.GetStatusUrl(post));
-        }
+            => Assert.Equal(expected, MyCommon.GetStatusUrl(post));
 
         [Theory]
         [InlineData("Favstar_LM", 249493863826350080L, "https://twitter.com/Favstar_LM/status/249493863826350080")]
         [InlineData("haru067", 200245741443235840L, "https://twitter.com/haru067/status/200245741443235840")]
         public void GetStatusUrlTest2(string screenName, long statusId, string expected)
-        {
-            Assert.Equal(expected, MyCommon.GetStatusUrl(screenName, statusId));
-        }
+            => Assert.Equal(expected, MyCommon.GetStatusUrl(screenName, statusId));
 
         [Fact]
         public void GetErrorLogPathTest()
index 133c811..5186a26 100644 (file)
@@ -35,14 +35,10 @@ namespace OpenTween
         private class TestForm : OTBaseForm { }
 
         public OTBaseFormTest()
-        {
-            this.SetupSynchronizationContext();
-        }
+            => this.SetupSynchronizationContext();
 
         protected void SetupSynchronizationContext()
-        {
-            WindowsFormsSynchronizationContext.AutoInstall = false;
-        }
+            => WindowsFormsSynchronizationContext.AutoInstall = false;
 
         [Fact]
         public async Task InvokeAsync_Test()
@@ -51,7 +47,7 @@ namespace OpenTween
             {
                 await Task.Run(async () =>
                 {
-                    await form.InvokeAsync(() => { form.Text = "hoge"; });
+                    await form.InvokeAsync(() => form.Text = "hoge");
                 });
 
                 Assert.Equal("hoge", form.Text);
index 853adaa..a5a490a 100644 (file)
@@ -427,9 +427,7 @@ namespace OpenTween
         }
 
         private HttpResponseMessage CreateRedirectResponse(string uriStr)
-        {
-            return this.CreateRedirectResponse(uriStr, UriKind.Absolute);
-        }
+            => this.CreateRedirectResponse(uriStr, UriKind.Absolute);
 
         private HttpResponseMessage CreateRedirectResponse(string uriStr, UriKind uriKind)
         {
index 58d70fc..0ca55fd 100644 (file)
@@ -106,9 +106,7 @@ namespace OpenTween
         }
 
         public static void FireEvent<T>(T control, string eventName) where T : Control
-        {
-            TestUtils.FireEvent(control, eventName, EventArgs.Empty);
-        }
+            => TestUtils.FireEvent(control, eventName, EventArgs.Empty);
 
         public static void FireEvent<T>(T control, string eventName, EventArgs e) where T : Control
         {
index 57b2492..903e035 100644 (file)
@@ -52,9 +52,7 @@ namespace OpenTween.Thumbnail.Services
             }
 
             public string GetApiBase()
-            {
-                return this.ApiBase;
-            }
+                => this.ApiBase;
 
             protected override Task<byte[]> FetchRegexAsync(string apiBase)
             {
index 01a176a..8515d16 100644 (file)
@@ -45,9 +45,7 @@ namespace OpenTween.Thumbnail.Services
             }
 
             protected override Task<string> FetchImageUrlAsync(string url, CancellationToken token)
-            {
-                return Task.FromResult(this.FakeHtml);
-            }
+                => Task.FromResult(this.FakeHtml);
         }
 
         [Fact]
index 2826ebb..b68ce1f 100644 (file)
@@ -47,9 +47,7 @@ namespace OpenTween.Thumbnail.Services
             }
 
             protected override Task<XDocument> FetchContentInfoApiAsync(string contentId, CancellationToken token)
-            {
-                return Task.FromResult(XDocument.Parse(this.FakeXml));
-            }
+                => Task.FromResult(XDocument.Parse(this.FakeXml));
         }
 
         [Fact]
index 4654203..7dc9458 100644 (file)
@@ -74,9 +74,7 @@ namespace OpenTween
             class MockThumbnailInfo : ThumbnailInfo
             {
                 public override Task<MemoryImage> LoadThumbnailImageAsync(HttpClient http, CancellationToken cancellationToken)
-                {
-                    return Task.FromResult(TestUtils.CreateDummyImage());
-                }
+                    => Task.FromResult(TestUtils.CreateDummyImage());
             }
         }
 
index 8392c3f..77edce9 100644 (file)
@@ -66,9 +66,7 @@ namespace OpenTween
         [InlineData("http://twitter.com/messages/compose?recipient_id=514241801", true)]
         [InlineData("https://twitter.com/messages/compose?recipient_id=514241801&text=%E3%81%BB%E3%81%92", true)]
         public void AttachmentUrlRegexTest(string url, bool isMatch)
-        {
-            Assert.Equal(isMatch, Twitter.AttachmentUrlRegex.IsMatch(url));
-        }
+            => Assert.Equal(isMatch, Twitter.AttachmentUrlRegex.IsMatch(url));
 
         [Theory]
         [InlineData("http://favstar.fm/users/twitterapi/status/22634515958", new[] { "22634515958" })]
index 02db1e3..2956ab4 100644 (file)
@@ -42,9 +42,7 @@ namespace OpenTween.Api.DataModel
         public double[] Coordinates { get; set; }
 
         public GeoJsonPoint()
-        {
-            this.Type = "Point";
-        }
+            => this.Type = "Point";
     }
 
     [DataContract]
@@ -54,8 +52,6 @@ namespace OpenTween.Api.DataModel
         public double[][][] Coordinates { get; set; }
 
         public GeoJsonPolygon()
-        {
-            this.Type = "Polygon";
-        }
+            => this.Type = "Polygon";
     }
 }
index 9250fe3..900f671 100644 (file)
@@ -63,9 +63,7 @@ namespace OpenTween.Api.DataModel
 
         /// <exception cref="SerializationException"/>
         public static TwitterConfiguration ParseJson(string json)
-        {
-            return MyCommon.CreateDataFromJson<TwitterConfiguration>(json);
-        }
+            => MyCommon.CreateDataFromJson<TwitterConfiguration>(json);
 
         /// <summary>
         /// 設定が取得できるまでの間に代わりに使用する適当な値を返します
index 5ec5b20..c570ead 100644 (file)
@@ -38,9 +38,7 @@ namespace OpenTween.Api.DataModel
 
         /// <exception cref="SerializationException"/>
         public static TwitterError ParseJson(string json)
-        {
-            return MyCommon.CreateDataFromJson<TwitterError>(json);
-        }
+            => MyCommon.CreateDataFromJson<TwitterError>(json);
     }
 
     [DataContract]
index 25bd8e2..40298dd 100644 (file)
@@ -99,8 +99,6 @@ namespace OpenTween.Api.DataModel
 
         /// <exception cref="SerializationException"/>
         public static TwitterFriendship ParseJson(string json)
-        {
-            return MyCommon.CreateDataFromJson<TwitterFriendship>(json);
-        }
+            => MyCommon.CreateDataFromJson<TwitterFriendship>(json);
     }
 }
index 777e3ae..955083f 100644 (file)
@@ -72,14 +72,10 @@ namespace OpenTween.Api.DataModel
 
         /// <exception cref="SerializationException"/>
         public static TwitterList ParseJson(string json)
-        {
-            return MyCommon.CreateDataFromJson<TwitterList>(json);
-        }
+            => MyCommon.CreateDataFromJson<TwitterList>(json);
 
         /// <exception cref="SerializationException"/>
         public static TwitterList[] ParseJsonArray(string json)
-        {
-            return MyCommon.CreateDataFromJson<TwitterList[]>(json);
-        }
+            => MyCommon.CreateDataFromJson<TwitterList[]>(json);
     }
 }
index ee1c059..3b58b85 100644 (file)
@@ -74,15 +74,11 @@ namespace OpenTween.Api.DataModel
 
         [IgnoreDataMember]
         public override long[] Items
-        {
-            get { return this.Ids; }
-        }
+            => this.Ids;
 
         /// <exception cref="SerializationException"/>
         public static TwitterIds ParseJson(string json)
-        {
-            return MyCommon.CreateDataFromJson<TwitterIds>(json);
-        }
+            => MyCommon.CreateDataFromJson<TwitterIds>(json);
     }
 
     [DataContract]
@@ -93,15 +89,11 @@ namespace OpenTween.Api.DataModel
 
         [IgnoreDataMember]
         public override TwitterUser[] Items
-        {
-            get { return this.Users; }
-        }
+            => this.Users;
 
         /// <exception cref="SerializationException"/>
         public static TwitterUsers ParseJson(string json)
-        {
-            return MyCommon.CreateDataFromJson<TwitterUsers>(json);
-        }
+            => MyCommon.CreateDataFromJson<TwitterUsers>(json);
     }
 
     [DataContract]
@@ -112,14 +104,10 @@ namespace OpenTween.Api.DataModel
 
         [IgnoreDataMember]
         public override TwitterList[] Items
-        {
-            get { return this.Lists; }
-        }
+            => this.Lists;
 
         /// <exception cref="SerializationException"/>
         public static TwitterLists ParseJson(string json)
-        {
-            return MyCommon.CreateDataFromJson<TwitterLists>(json);
-        }
+            => MyCommon.CreateDataFromJson<TwitterLists>(json);
     }
 }
index 5a3538f..6b0d881 100644 (file)
@@ -59,8 +59,6 @@ namespace OpenTween.Api.DataModel
 
         /// <exception cref="SerializationException"/>
         public static TwitterRateLimits ParseJson(string json)
-        {
-            return MyCommon.CreateDataFromJson<TwitterRateLimits>(json);
-        }
+            => MyCommon.CreateDataFromJson<TwitterRateLimits>(json);
     }
 }
index b585600..3b60b24 100644 (file)
@@ -70,8 +70,6 @@ namespace OpenTween.Api.DataModel
 
         /// <exception cref="SerializationException"/>
         public static TwitterSearchResult ParseJson(string json)
-        {
-            return MyCommon.CreateDataFromJson<TwitterSearchResult>(json);
-        }
+            => MyCommon.CreateDataFromJson<TwitterSearchResult>(json);
     }
 }
index 27ee966..27e4f48 100644 (file)
@@ -162,15 +162,11 @@ namespace OpenTween.Api.DataModel
 
         /// <exception cref="SerializationException"/>
         public static TwitterStatus ParseJson(string json)
-        {
-            return MyCommon.CreateDataFromJson<TwitterStatus>(json);
-        }
+            => MyCommon.CreateDataFromJson<TwitterStatus>(json);
 
         /// <exception cref="SerializationException"/>
         public static TwitterStatus[] ParseJsonArray(string json)
-        {
-            return MyCommon.CreateDataFromJson<TwitterStatus[]>(json);
-        }
+            => MyCommon.CreateDataFromJson<TwitterStatus[]>(json);
     }
 
     [DataContract]
@@ -378,15 +374,11 @@ namespace OpenTween.Api.DataModel
 
         /// <exception cref="SerializationException"/>
         public static TwitterStatusCompat ParseJson(string json)
-        {
-            return MyCommon.CreateDataFromJson<TwitterStatusCompat>(json);
-        }
+            => MyCommon.CreateDataFromJson<TwitterStatusCompat>(json);
 
         /// <exception cref="SerializationException"/>
         public static TwitterStatusCompat[] ParseJsonArray(string json)
-        {
-            return MyCommon.CreateDataFromJson<TwitterStatusCompat[]>(json);
-        }
+            => MyCommon.CreateDataFromJson<TwitterStatusCompat[]>(json);
     }
 
     [DataContract]
@@ -433,14 +425,10 @@ namespace OpenTween.Api.DataModel
 
         /// <exception cref="SerializationException"/>
         public static TwitterDirectMessage ParseJson(string json)
-        {
-            return MyCommon.CreateDataFromJson<TwitterDirectMessage>(json);
-        }
+            => MyCommon.CreateDataFromJson<TwitterDirectMessage>(json);
 
         /// <exception cref="SerializationException"/>
         public static TwitterDirectMessage[] ParseJsonArray(string json)
-        {
-            return MyCommon.CreateDataFromJson<TwitterDirectMessage[]>(json);
-        }
+            => MyCommon.CreateDataFromJson<TwitterDirectMessage[]>(json);
     }
 }
index 2469c13..da1fa0b 100644 (file)
@@ -45,9 +45,7 @@ namespace OpenTween.Api.DataModel
 
         /// <exception cref="SerializationException"/>
         public static TwitterStreamEvent ParseJson(string json)
-        {
-            return MyCommon.CreateDataFromJson<TwitterStreamEvent>(json);
-        }
+            => MyCommon.CreateDataFromJson<TwitterStreamEvent>(json);
     }
 
     [DataContract]
@@ -58,8 +56,6 @@ namespace OpenTween.Api.DataModel
 
         /// <exception cref="SerializationException"/>
         public static new TwitterStreamEvent<T> ParseJson(string json)
-        {
-            return MyCommon.CreateDataFromJson<TwitterStreamEvent<T>>(json);
-        }
+            => MyCommon.CreateDataFromJson<TwitterStreamEvent<T>>(json);
     }
 }
index dea717e..d0c0488 100644 (file)
@@ -62,9 +62,7 @@ namespace OpenTween.Api.DataModel
 
         /// <exception cref="SerializationException"/>
         public static TwitterTextConfiguration ParseJson(string json)
-        {
-            return MyCommon.CreateDataFromJson<TwitterTextConfiguration>(json);
-        }
+            => MyCommon.CreateDataFromJson<TwitterTextConfiguration>(json);
 
         public static TwitterTextConfiguration DefaultConfiguration()
         {
index 78a0449..655561b 100644 (file)
@@ -112,8 +112,6 @@ namespace OpenTween.Api.DataModel
 
         /// <exception cref="SerializationException"/>
         public static TwitterUser ParseJson(string json)
-        {
-            return MyCommon.CreateDataFromJson<TwitterUser>(json);
-        }
+            => MyCommon.CreateDataFromJson<TwitterUser>(json);
     }
 }
index c583dab..17b7679 100644 (file)
@@ -689,23 +689,19 @@ namespace OpenTween.Models
         /// この振り分けルールにマッチ条件が含まれているかを返します
         /// </summary>
         public bool HasMatchConditions()
-        {
-            return !string.IsNullOrEmpty(this.FilterName) ||
+            => !string.IsNullOrEmpty(this.FilterName) ||
                 this.FilterBody.Any(x => !string.IsNullOrEmpty(x)) ||
                 !string.IsNullOrEmpty(this.FilterSource) ||
                 this.FilterRt;
-        }
 
         /// <summary>
         /// この振り分けルールに除外条件が含まれているかを返します
         /// </summary>
         public bool HasExcludeConditions()
-        {
-            return !string.IsNullOrEmpty(this.ExFilterName) ||
+            => !string.IsNullOrEmpty(this.ExFilterName) ||
                 this.ExFilterBody.Any(x => !string.IsNullOrEmpty(x)) ||
                 !string.IsNullOrEmpty(this.ExFilterSource) ||
                 this.ExFilterRt;
-        }
 
         public override bool Equals(object obj)
             => this.Equals(obj as PostFilterRule);
@@ -751,13 +747,11 @@ namespace OpenTween.Models
         }
 
         public override int GetHashCode()
-        {
-            return this.FilterName?.GetHashCode() ?? 0 ^
+            => this.FilterName?.GetHashCode() ?? 0 ^
                 this.FilterSource?.GetHashCode() ?? 0 ^
                 this.FilterBody.Select(x => x?.GetHashCode() ?? 0).Sum() ^
                 this.ExFilterName?.GetHashCode() ?? 0 ^
                 this.ExFilterSource?.GetHashCode() ?? 0 ^
                 this.ExFilterBody.Select(x => x?.GetHashCode() ?? 0).Sum();
-        }
     }
 }
index a54a63a..44e1628 100644 (file)
@@ -337,11 +337,9 @@ namespace OpenTween
         /// 指定されたスケールと SettingLocal.ScaleDimension のスケールとの拡大比を返します
         /// </summary>
         public SizeF GetConfigScaleFactor(SizeF currentSizeDimension)
-        {
-            return new SizeF(
+            => new SizeF(
                 currentSizeDimension.Width / this.ScaleDimension.Width,
                 currentSizeDimension.Height / this.ScaleDimension.Height);
-        }
 
         public void Dispose()
         {
index 20d41f8..f15ef54 100644 (file)
@@ -100,14 +100,12 @@ namespace OpenTween.Thumbnail
             => this.Equals(obj as ThumbnailInfo);
 
         public bool Equals(ThumbnailInfo other)
-        {
-            return other != null &&
+            => other != null &&
                 other.MediaPageUrl == this.MediaPageUrl &&
                 other.ThumbnailImageUrl == this.ThumbnailImageUrl &&
                 other.TooltipText == this.TooltipText &&
                 other.FullSizeImageUrl == this.FullSizeImageUrl &&
                 other.IsPlayable == this.IsPlayable;
-        }
 
         public override int GetHashCode()
             => this.MediaPageUrl.GetHashCode() ^ this.ThumbnailImageUrl.GetHashCode();
index 7ffef93..80366ad 100644 (file)
@@ -6771,14 +6771,14 @@ namespace OpenTween
                         for (var i = postList.Count - 1; i >= 0; i--)
                         {
                             var index = i;
-                            if (postList.FindIndex((pst) => { return pst.Post.StatusId == postList[index].Post.StatusId; }) != index)
+                            if (postList.FindIndex(pst => pst.Post.StatusId == postList[index].Post.StatusId) != index)
                             {
                                 postList.RemoveAt(index);
                             }
                         }
                         var currentIndex = this.CurrentTab.SelectedIndex;
-                        var post = postList.FirstOrDefault((pst) => { return pst.Tab == curTabClass && isForward ? pst.Index > currentIndex : pst.Index < currentIndex; });
-                        if (post == null) post = postList.FirstOrDefault((pst) => { return pst.Tab != curTabClass; });
+                        var post = postList.FirstOrDefault(pst => pst.Tab == curTabClass && isForward ? pst.Index > currentIndex : pst.Index < currentIndex);
+                        if (post == null) post = postList.FirstOrDefault(pst => pst.Tab != curTabClass);
                         if (post == null) post = postList.First();
                         var tabIndex = this._statuses.Tabs.IndexOf(post.Tab);
                         this.ListTab.SelectedIndex = tabIndex;