From 0f160e9663160d814b398321be43a0c60ead149e Mon Sep 17 00:00:00 2001 From: Jennifer Taylor Date: Sat, 29 May 2021 22:10:08 +0000 Subject: [PATCH] Get rid of unnecessary length calls. --- bemani/format/afp/geo.py | 2 +- bemani/format/afp/util.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bemani/format/afp/geo.py b/bemani/format/afp/geo.py index ec851ea..75d857c 100644 --- a/bemani/format/afp/geo.py +++ b/bemani/format/afp/geo.py @@ -182,7 +182,7 @@ class Shape: if mode != 4: raise Exception("Unexpected mode in GE2D structure!") - if (flags & 0x2) and len(labels) == 0: + if (flags & 0x2) and not labels: raise Exception("GE2D structure has a texture, but no region labels present!") if (flags & 0x2) and (tex1 == 0xFF): raise Exception("GE2D structure requests a texture, but no texture pointer present!") diff --git a/bemani/format/afp/util.py b/bemani/format/afp/util.py index dafc903..61d5f1b 100644 --- a/bemani/format/afp/util.py +++ b/bemani/format/afp/util.py @@ -23,7 +23,7 @@ def pad(data: bytes, length: int) -> bytes: def descramble_text(text: bytes, obfuscated: bool) -> str: - if len(text): + if text: if obfuscated and (text[0] - 0x20) > 0x7F: # Gotta do a weird demangling where we swap the # top bit.