From 35b595cff0ec62d879b5c0919db2218ad73b31ce Mon Sep 17 00:00:00 2001 From: Cj <161484149+CJ-SPT@users.noreply.github.com> Date: Thu, 18 Sep 2025 14:19:11 -0400 Subject: [PATCH] Prefer `Count` over `Any()` --- .../Generators/BotInventoryGenerator.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Libraries/SPTarkov.Server.Core/Generators/BotInventoryGenerator.cs b/Libraries/SPTarkov.Server.Core/Generators/BotInventoryGenerator.cs index 2cf10e41..0598e1f7 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/BotInventoryGenerator.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/BotInventoryGenerator.cs @@ -502,7 +502,7 @@ public class BotInventoryGenerator( // Roll dice on equipment item var shouldSpawn = randomUtil.GetChance100(spawnChance.Value); - if (shouldSpawn && settings.RootEquipmentPool.Any()) + if (shouldSpawn && settings.RootEquipmentPool?.Count != 0) { TemplateItem? pickedItemDb = null; var found = false; @@ -512,7 +512,7 @@ public class BotInventoryGenerator( var attempts = 0; while (!found) { - if (!settings.RootEquipmentPool.Any()) + if (settings.RootEquipmentPool.Count == 0) { return false; } @@ -649,7 +649,7 @@ public class BotInventoryGenerator( } var filteredMods = modsForSlot.Where(mod => !blacklistedMods.Contains(mod)).ToHashSet(); - if (filteredMods.Any()) + if (filteredMods.Count != 0) { // There's at least one tpl remaining, send it return filteredMods;