From a6e4208b409fed0cab0bfbcda0272762e6d9ae63 Mon Sep 17 00:00:00 2001 From: JustArchi Date: Sat, 26 Jan 2019 18:17:07 +0100 Subject: [PATCH] Misc optimization --- ArchiSteamFarm/Trading.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ArchiSteamFarm/Trading.cs b/ArchiSteamFarm/Trading.cs index 499d18d4a..b8b63411c 100644 --- a/ArchiSteamFarm/Trading.cs +++ b/ArchiSteamFarm/Trading.cs @@ -152,10 +152,10 @@ namespace ArchiSteamFarm { Dictionary<(uint AppID, Steam.Asset.EType Type), List> finalSets = GetInventorySets(inventory); // Once we have both states, we can check overall fairness - foreach (((uint AppID, Steam.Asset.EType Type) set, List afterAmounts) in finalSets) { - if (!initialSets.TryGetValue(set, out List beforeAmounts)) { - // If we have no info about this set, then it has to be a donation - continue; + foreach (((uint AppID, Steam.Asset.EType Type) set, List beforeAmounts) in initialSets) { + if (!finalSets.TryGetValue(set, out List afterAmounts)) { + // If we have no info about this set, then it has to be a bad one + return false; } // If amount of unique items in the set decreases, this is always a bad trade (e.g. 1 1 -> 0 2)