From cabd00820409d71f4bad2d0963954fabce79b04c Mon Sep 17 00:00:00 2001 From: Yui Date: Tue, 26 Nov 2024 02:35:35 -0300 Subject: [PATCH] feat: replaced ItemUtils.GetArmorDurability() loop with Sum() function. --- Plugin/Utils/ItemUtils.cs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Plugin/Utils/ItemUtils.cs b/Plugin/Utils/ItemUtils.cs index 0374c3d..05e42a4 100644 --- a/Plugin/Utils/ItemUtils.cs +++ b/Plugin/Utils/ItemUtils.cs @@ -6,15 +6,7 @@ namespace LootValueEX.Utils { internal static class ItemUtils { - internal static float GetArmorDurability(IEnumerable repairableComponents) - { - float totalDurability = 0; - foreach (RepairableComponent component in repairableComponents) - { - totalDurability += component.Durability; - } - return totalDurability; - } + internal static float GetArmorDurability(IEnumerable repairableComponents) => repairableComponents.Sum(x => x.Durability); internal static Task GetBestTraderValueAsync(Item item) {