From a839460e9afeaaf46bf2beabfa22cccd48e2f3bc Mon Sep 17 00:00:00 2001 From: xeals Date: Tue, 4 Apr 2023 22:44:46 +1000 Subject: [PATCH] optimise missing team logging to use a set --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 6b42faa..97ef470 100755 --- a/main.py +++ b/main.py @@ -113,7 +113,7 @@ def tag(tagged: TaggedPlayer | TaggedPokemon) -> PlayerTag: TEAMS: dict[Player, Player] = {} -_logged_teams: list[Player] = [] +_logged_teams: set[Player] = set() def team(player: Player) -> Player: @@ -123,7 +123,7 @@ def team(player: Player) -> Player: else: if not player in _logged_teams and player: LOG.warning(f"missing team mapping for {player}") - _logged_teams.append(player) + _logged_teams.add(player) return player