mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-04-19 16:33:36 +03:00
Resolve notices (?)
Signed-off-by: mctaylors <cantsendmails@mctaylors.ru>
This commit is contained in:
parent
d8b613ecd1
commit
0580330b3a
3 changed files with 3 additions and 3 deletions
|
@ -8,7 +8,7 @@ public static class CollectionExtensions
|
|||
this IEnumerable<TSource> source, Func<TSource, TResult> selector)
|
||||
{
|
||||
var list = source.ToList();
|
||||
return list.Any() ? list.Max(selector) : default;
|
||||
return list.Count != 0 ? list.Max(selector) : default;
|
||||
}
|
||||
|
||||
public static void AddIfFailed(this List<Result> list, Result result)
|
||||
|
|
|
@ -45,7 +45,7 @@ public static class StringExtensions
|
|||
{
|
||||
s = s.SanitizeForBlockCode();
|
||||
return
|
||||
$"```{language}\n{s.SanitizeForBlockCode()}{(s.EndsWith("`", StringComparison.Ordinal) || string.IsNullOrWhiteSpace(s) ? " " : "")}```";
|
||||
$"```{language}\n{s.SanitizeForBlockCode()}{(s.EndsWith('`') || string.IsNullOrWhiteSpace(s) ? " " : "")}```";
|
||||
}
|
||||
|
||||
public static string Localized(this string key)
|
||||
|
|
|
@ -126,7 +126,7 @@ public sealed class ScheduledEventUpdateService : BackgroundService
|
|||
{
|
||||
var filtered = from.Where(schEvent => schEvent.ID == id);
|
||||
var filteredArray = filtered.ToArray();
|
||||
return filteredArray.Any()
|
||||
return filteredArray.Length != 0
|
||||
? Result<IGuildScheduledEvent>.FromSuccess(filteredArray.Single())
|
||||
: new NotFoundError();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue