Prefer Count over Any()
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user