vars and target-typed new

This commit is contained in:
Kwoth
2021-12-20 00:15:39 +01:00
parent ee33313519
commit cd379fd308
75 changed files with 198 additions and 198 deletions

View File

@@ -72,7 +72,7 @@ public class FeedsService : INService
.Reverse() // start from the oldest
.ToList();
if (!_lastPosts.TryGetValue(kvp.Key, out DateTime lastFeedUpdate))
if (!_lastPosts.TryGetValue(kvp.Key, out var lastFeedUpdate))
{
lastFeedUpdate = _lastPosts[kvp.Key] =
items.Any() ? items[items.Count - 1].LastUpdate : DateTime.UtcNow;

View File

@@ -77,7 +77,7 @@ public class SearchesService : INService
public async Task<Stream> GetRipPictureAsync(string text, Uri imgUrl)
{
byte[] data = await _cache.GetOrAddCachedDataAsync($"nadeko_rip_{text}_{imgUrl}",
var data = await _cache.GetOrAddCachedDataAsync($"nadeko_rip_{text}_{imgUrl}",
GetRipPictureFactory,
(text, imgUrl),
TimeSpan.FromDays(1)).ConfigureAwait(false);
@@ -388,7 +388,7 @@ public class SearchesService : INService
return new MtgData[0];
var tasks = new List<Task<MtgData>>(cards.Length);
for (int i = 0; i < cards.Length; i++)
for (var i = 0; i < cards.Length; i++)
{
var card = cards[i];