Replaced single loop with key lookup inside BindItem

This commit is contained in:
Chomp
2025-03-08 09:17:57 +00:00
parent 6d2c5e0e19
commit 0d23400db3
@@ -610,11 +610,10 @@ public class InventoryController(
public void BindItem(PmcData pmcData, InventoryBindRequestData bindRequest, string sessionId,
ItemEventRouterResponse output)
{
foreach (var kvp in pmcData.Inventory.FastPanel.Where(kvp => kvp.Value == bindRequest.Index))
// Remove link
if (pmcData.Inventory.FastPanel.ContainsKey(bindRequest.Index))
{
pmcData.Inventory.FastPanel.Remove(kvp.Key);
break;
pmcData.Inventory.FastPanel.Remove(bindRequest.Index);
}
// Create link between fast panel slot and requested item