From 68e4e50d197851c89ad9f2e11d79ed1deb651a8e Mon Sep 17 00:00:00 2001 From: Luke Robles Date: Wed, 14 Jun 2023 13:50:50 -0700 Subject: [PATCH] Add a break to the price calculation loop to save sweet sweet cpu cycles --- app/star_citizen.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/star_citizen.py b/app/star_citizen.py index 8f3192c5..01f8a49c 100644 --- a/app/star_citizen.py +++ b/app/star_citizen.py @@ -227,6 +227,7 @@ async def calculate_trade_profies(commodity, scu=None): for station, trades in stations.items(): if "buy" in trades and commodity in trades["buy"]: costs[station] = trades["buy"][commodity] * int(scu) + break embed.add_field( name="**Cheapest place to fill %s**" % scu_string, @@ -244,6 +245,7 @@ async def calculate_trade_profies(commodity, scu=None): for station, trades in stations.items(): if "sell" in trades and commodity in trades["sell"]: profits[station] = trades["sell"][commodity] * int(scu) + break embed.add_field( name="Most profitable place to sell %s" % scu_string,