optimise missing team logging to use a set

This commit is contained in:
xeals 2023-04-04 22:44:46 +10:00
parent 8f8b96937d
commit a839460e9a
Signed by: xeals
GPG Key ID: A498C7AF27EC6B5C

View File

@ -113,7 +113,7 @@ def tag(tagged: TaggedPlayer | TaggedPokemon) -> PlayerTag:
TEAMS: dict[Player, Player] = {} TEAMS: dict[Player, Player] = {}
_logged_teams: list[Player] = [] _logged_teams: set[Player] = set()
def team(player: Player) -> Player: def team(player: Player) -> Player:
@ -123,7 +123,7 @@ def team(player: Player) -> Player:
else: else:
if not player in _logged_teams and player: if not player in _logged_teams and player:
LOG.warning(f"missing team mapping for {player}") LOG.warning(f"missing team mapping for {player}")
_logged_teams.append(player) _logged_teams.add(player)
return player return player