feat: replaced ItemUtils.GetArmorDurability() loop with Sum() function.

This commit is contained in:
Yui 2024-11-26 02:35:35 -03:00
parent 7734090feb
commit cabd008204
Signed by: yui
GPG Key ID: F368D23A0ABA04B4

View File

@ -6,15 +6,7 @@ namespace LootValueEX.Utils
{
internal static class ItemUtils
{
internal static float GetArmorDurability(IEnumerable<RepairableComponent> repairableComponents)
{
float totalDurability = 0;
foreach (RepairableComponent component in repairableComponents)
{
totalDurability += component.Durability;
}
return totalDurability;
}
internal static float GetArmorDurability(IEnumerable<RepairableComponent> repairableComponents) => repairableComponents.Sum(x => x.Durability);
internal static Task<Structs.TradeOfferStruct> GetBestTraderValueAsync(Item item)
{