From 5af5c78a4f72ff29aed8e386da8b34c1a5b351da Mon Sep 17 00:00:00 2001 From: Dmytro Litvinov Date: Sat, 16 Oct 2021 06:58:59 +0300 Subject: [PATCH] Improve time-complexity The complexity for lists, tuples is: `O(n)` The complexity for sets is: `O(1)` http://wiki.python.org/moin/TimeComplexity --- binance_trade_bot/binance_stream_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/binance_trade_bot/binance_stream_manager.py b/binance_trade_bot/binance_stream_manager.py index 7199b13f4..50b52fef9 100644 --- a/binance_trade_bot/binance_stream_manager.py +++ b/binance_trade_bot/binance_stream_manager.py @@ -154,7 +154,7 @@ def _process_stream_data(self, stream_data): asset = stream_data["asset"] if asset in balances: del balances[stream_data["asset"]] - elif event_type in ("outboundAccountPosition", "outboundAccountInfo"): # !userData + elif event_type in {"outboundAccountPosition", "outboundAccountInfo"}: # !userData self.logger.debug(f"{event_type}: {stream_data}") with self.cache.open_balances() as balances: for bal in stream_data["balances"]: