Prefer Count over Any()

This commit is contained in:
Cj
2025-09-18 14:19:11 -04:00
parent f3470aac59
commit 35b595cff0
@@ -502,7 +502,7 @@ public class BotInventoryGenerator(
// Roll dice on equipment item // Roll dice on equipment item
var shouldSpawn = randomUtil.GetChance100(spawnChance.Value); var shouldSpawn = randomUtil.GetChance100(spawnChance.Value);
if (shouldSpawn && settings.RootEquipmentPool.Any()) if (shouldSpawn && settings.RootEquipmentPool?.Count != 0)
{ {
TemplateItem? pickedItemDb = null; TemplateItem? pickedItemDb = null;
var found = false; var found = false;
@@ -512,7 +512,7 @@ public class BotInventoryGenerator(
var attempts = 0; var attempts = 0;
while (!found) while (!found)
{ {
if (!settings.RootEquipmentPool.Any()) if (settings.RootEquipmentPool.Count == 0)
{ {
return false; return false;
} }
@@ -649,7 +649,7 @@ public class BotInventoryGenerator(
} }
var filteredMods = modsForSlot.Where(mod => !blacklistedMods.Contains(mod)).ToHashSet(); 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 // There's at least one tpl remaining, send it
return filteredMods; return filteredMods;