diff --git a/bemani/data/mysql/music.py b/bemani/data/mysql/music.py index 0d4dd82..c5483bc 100644 --- a/bemani/data/mysql/music.py +++ b/bemani/data/mysql/music.py @@ -838,7 +838,7 @@ class MusicData(BaseData): result["points"], result["timestamp"], result["lid"], - True if result["new_record"] == 1 else False, + result["new_record"] == 1, self.deserialize(result["data"]), ), ) @@ -924,7 +924,7 @@ class MusicData(BaseData): result["points"], result["timestamp"], result["lid"], - True if result["new_record"] == 1 else False, + result["new_record"] == 1, self.deserialize(result["data"]), ), ) diff --git a/bemani/protocol/node.py b/bemani/protocol/node.py index 7413c18..08d3926 100644 --- a/bemani/protocol/node.py +++ b/bemani/protocol/node.py @@ -884,7 +884,7 @@ class Node: def str_to_val(string: Union[str, bytes]) -> Any: if translated_type["name"] == "bool": - return True if string == "true" else False + return string == "true" elif translated_type["name"] == "float": return float(string) elif translated_type["name"] == "ip4": diff --git a/bemani/sniff/sniff.py b/bemani/sniff/sniff.py index f67f2c0..ea67356 100644 --- a/bemani/sniff/sniff.py +++ b/bemani/sniff/sniff.py @@ -298,15 +298,15 @@ class Sniffer: by the flag name who's value is True if set and False otherwise. """ return { - "ns": True if flags & 0x100 else False, - "cwr": True if flags & 0x080 else False, - "ece": True if flags & 0x040 else False, - "urg": True if flags & 0x020 else False, - "ack": True if flags & 0x010 else False, - "psh": True if flags & 0x008 else False, - "rst": True if flags & 0x004 else False, - "syn": True if flags & 0x002 else False, - "fin": True if flags & 0x001 else False, + "ns": bool(flags & 0x100), + "cwr": bool(flags & 0x080), + "ece": bool(flags & 0x040), + "urg": bool(flags & 0x020), + "ack": bool(flags & 0x010), + "psh": bool(flags & 0x008), + "rst": bool(flags & 0x004), + "syn": bool(flags & 0x002), + "fin": bool(flags & 0x001), } def __process_address(