Fix CA1860: Avoid using 'Enumerable.Any()' extension method

This commit is contained in:
Haselnussbomber 2025-10-24 02:35:44 +02:00
parent fe37da1b94
commit d060db3ca4
No known key found for this signature in database
GPG key ID: BB905BB49E7295D1
10 changed files with 22 additions and 22 deletions

View file

@ -357,7 +357,7 @@ internal class PluginImageCache : IInternalDisposableService
try
{
token.ThrowIfCancellationRequested();
if (!pendingFuncs.Any())
if (pendingFuncs.Count == 0)
{
if (!this.downloadQueue.TryTake(out var taskTuple, -1, token))
return;
@ -373,7 +373,7 @@ internal class PluginImageCache : IInternalDisposableService
pendingFuncs = pendingFuncs.OrderBy(x => x.Item1).ToList();
var item1 = pendingFuncs.Last().Item1;
while (pendingFuncs.Any() && pendingFuncs.Last().Item1 == item1)
while (pendingFuncs.Count != 0 && pendingFuncs.Last().Item1 == item1)
{
token.ThrowIfCancellationRequested();
while (runningTasks.Count >= concurrency)

View file

@ -186,7 +186,7 @@ internal class PluginStatWindow : Window
ImGui.SameLine();
ImGuiComponents.TextWithLabel("Total Average", $"{totalAverage:F4}ms", "All average update times added together");
ImGui.SameLine();
ImGuiComponents.TextWithLabel("Collective Average", $"{(statsHistory.Any() ? totalAverage / statsHistory.Length : 0):F4}ms", "Average of all average update times");
ImGuiComponents.TextWithLabel("Collective Average", $"{(statsHistory.Length != 0 ? totalAverage / statsHistory.Length : 0):F4}ms", "Average of all average update times");
ImGui.InputTextWithHint(
"###PluginStatWindow_FrameworkSearch"u8,
@ -230,7 +230,7 @@ internal class PluginStatWindow : Window
foreach (var handlerHistory in statsHistory)
{
if (!handlerHistory.Value.Any())
if (handlerHistory.Value.Count == 0)
{
continue;
}