From f2add920c702b83ca377be8d187a456fd6d99a8f Mon Sep 17 00:00:00 2001 From: A_D Date: Tue, 25 Aug 2020 12:06:26 +0200 Subject: [PATCH] replaced constant contains checks with tuples --- plugins/edsm.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/edsm.py b/plugins/edsm.py index f13517a4..9868d57f 100644 --- a/plugins/edsm.py +++ b/plugins/edsm.py @@ -361,7 +361,7 @@ entry: {entry!r}''' elif entry['event'] == 'LoadGame': this.coordinates = None - if entry['event'] in ['LoadGame', 'Commander', 'NewCommander']: + if entry['event'] in ('LoadGame', 'Commander', 'NewCommander'): this.newgame = True this.newgame_docked = False this.navbeaconscan = 0 @@ -523,7 +523,7 @@ def worker() -> None: else: for e, r in zip(pending, reply['events']): - if not closing and e['event'] in ['StartUp', 'Location', 'FSDJump', 'CarrierJump']: + if not closing and e['event'] in ('StartUp', 'Location', 'FSDJump', 'CarrierJump'): # Update main window's system status this.lastlookup = r # calls update_status in main thread @@ -558,7 +558,7 @@ def should_send(entries: List[Mapping[str, Any]]) -> bool: else: assert(False) - this.navbeaconscan = 0 + this.navbeaconscan = 0 # TODO: Unreachable code? for entry in entries: if (entry['event'] == 'Cargo' and not this.newgame_docked) or entry['event'] == 'Docked': @@ -570,10 +570,10 @@ def should_send(entries: List[Mapping[str, Any]]) -> bool: elif this.newgame: pass - elif entry['event'] not in [ + elif entry['event'] not in ( 'CommunityGoal', # Spammed periodically 'ModuleBuy', 'ModuleSell', 'ModuleSwap', # will be shortly followed by "Loadout" - 'ShipyardBuy', 'ShipyardNew', 'ShipyardSwap']: # " + 'ShipyardBuy', 'ShipyardNew', 'ShipyardSwap'): # " return True return False