mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-05 06:44:51 +00:00
Remove unnecessary checks
This commit is contained in:
parent
f30746a0b2
commit
29ef38df89
1 changed files with 1 additions and 7 deletions
|
|
@ -41,13 +41,7 @@ class BoolTrue(BoolFalse):
|
||||||
class Bool(Object):
|
class Bool(Object):
|
||||||
@classmethod
|
@classmethod
|
||||||
def read(cls, b: BytesIO) -> bool:
|
def read(cls, b: BytesIO) -> bool:
|
||||||
value = int.from_bytes(b.read(4), "little")
|
return int.from_bytes(b.read(4), "little") == BoolTrue.ID
|
||||||
|
|
||||||
return (
|
|
||||||
True if value == BoolTrue.ID
|
|
||||||
else False if value == BoolFalse.ID
|
|
||||||
else None
|
|
||||||
)
|
|
||||||
|
|
||||||
def __new__(cls, value: bool) -> BoolTrue or BoolFalse:
|
def __new__(cls, value: bool) -> BoolTrue or BoolFalse:
|
||||||
return BoolTrue() if value else BoolFalse()
|
return BoolTrue() if value else BoolFalse()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue