From f4f1817e3132d9471ff9aaf629f8485be6b176ea Mon Sep 17 00:00:00 2001 From: Darren Thompson Date: Sat, 2 Aug 2025 16:10:34 -0400 Subject: [PATCH] Use "in" clause on dict instead of new method --- bemani/backend/ddr/ddrsn2/playerinfo.py | 3 +-- bemani/common/validateddict.py | 6 ------ 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/bemani/backend/ddr/ddrsn2/playerinfo.py b/bemani/backend/ddr/ddrsn2/playerinfo.py index c5b2ad8..60fc7e8 100644 --- a/bemani/backend/ddr/ddrsn2/playerinfo.py +++ b/bemani/backend/ddr/ddrsn2/playerinfo.py @@ -70,8 +70,7 @@ class PlayerInfo: idx = 0 - # Empty option set is a non-zero opt array, unsure how to do this check with validated_dict cleanly? - if not profile.has_key("opt"): + if "opt" not in profile: profile.replace_int_array("opt", 16, [2, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 2, 0, 0, 0, 0]) for entry in profile.get_int_array("opt", 16): diff --git a/bemani/common/validateddict.py b/bemani/common/validateddict.py index 2d7403c..cc2ba8a 100644 --- a/bemani/common/validateddict.py +++ b/bemani/common/validateddict.py @@ -444,12 +444,6 @@ class ValidatedDict(dict): else: self[name] = self[name] + 1 - def has_key(self, name: str) -> bool: - if name in self: - return True - - return False - class Profile(ValidatedDict): """