From 4f61cfe30a03d2377616e48c24bb3eaa365dc073 Mon Sep 17 00:00:00 2001 From: Jennifer Taylor Date: Thu, 19 Aug 2021 19:21:04 +0000 Subject: [PATCH] Switch to sets for membership queries. --- bemani/api/objects/catalog.py | 2 +- bemani/api/objects/records.py | 2 +- bemani/api/objects/statistics.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bemani/api/objects/catalog.py b/bemani/api/objects/catalog.py index 3abf33c..74b4347 100644 --- a/bemani/api/objects/catalog.py +++ b/bemani/api/objects/catalog.py @@ -184,7 +184,7 @@ class CatalogObject(BaseObject): @property def music_version(self) -> int: - if self.game in [GameConstants.IIDX, GameConstants.MUSECA]: + if self.game in {GameConstants.IIDX, GameConstants.MUSECA}: if self.omnimix: return self.version + DBConstants.OMNIMIX_VERSION_BUMP else: diff --git a/bemani/api/objects/records.py b/bemani/api/objects/records.py index 8218e31..ddc90b6 100644 --- a/bemani/api/objects/records.py +++ b/bemani/api/objects/records.py @@ -222,7 +222,7 @@ class RecordsObject(BaseObject): @property def music_version(self) -> int: - if self.game in [GameConstants.IIDX, GameConstants.MUSECA]: + if self.game in {GameConstants.IIDX, GameConstants.MUSECA}: if self.omnimix: return self.version + DBConstants.OMNIMIX_VERSION_BUMP else: diff --git a/bemani/api/objects/statistics.py b/bemani/api/objects/statistics.py index 2065959..9d51da5 100644 --- a/bemani/api/objects/statistics.py +++ b/bemani/api/objects/statistics.py @@ -25,7 +25,7 @@ class StatisticsObject(BaseObject): @property def music_version(self) -> int: - if self.game in [GameConstants.IIDX, GameConstants.MUSECA]: + if self.game in {GameConstants.IIDX, GameConstants.MUSECA}: if self.omnimix: return self.version + DBConstants.OMNIMIX_VERSION_BUMP else: @@ -34,12 +34,12 @@ class StatisticsObject(BaseObject): return self.version def __is_play(self, attempt: Attempt) -> bool: - if self.game in [ + if self.game in { GameConstants.DDR, GameConstants.JUBEAT, GameConstants.MUSECA, GameConstants.POPN_MUSIC, - ]: + }: return True if self.game == GameConstants.IIDX: return attempt.data.get_int('clear_status') != DBConstants.IIDX_CLEAR_STATUS_NO_PLAY