More target-typed new and redundant paranthesis cleanup

This commit is contained in:
Kwoth
2021-12-20 00:33:11 +01:00
parent 345a9e9524
commit 1b2017024c
152 changed files with 573 additions and 580 deletions

View File

@@ -42,11 +42,11 @@ where ((guildid >> 22) % {_creds.TotalShards}) == {_client.ShardId};")
.AsNoTracking()
.ToList();
_noRedundant = new ConcurrentHashSet<int>(shardRepeaters
_noRedundant = new(shardRepeaters
.Where(x => x.NoRedundant)
.Select(x => x.Id));
_repeaterQueue = new LinkedList<RunningRepeater>(shardRepeaters
_repeaterQueue = new(shardRepeaters
.Select(rep => new RunningRepeater(rep))
.OrderBy(x => x.NextTime));
}
@@ -245,7 +245,7 @@ where ((guildid >> 22) % {_creds.TotalShards}) == {_client.ShardId};")
}
}
if (repeater.LastMessageId is ulong lastMessageId)
if (repeater.LastMessageId is { } lastMessageId)
{
try
{
@@ -318,7 +318,7 @@ where ((guildid >> 22) % {_creds.TotalShards}) == {_client.ShardId};")
await uow.Repeaters
.AsQueryable()
.Where(x => x.Id == repeaterId)
.UpdateAsync(rep => new Repeater()
.UpdateAsync(rep => new()
{
LastMessageId = lastMsgId
});