mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-27 16:45:19 +00:00
Remove unnecessary checks
This commit is contained in:
parent
f30746a0b2
commit
29ef38df89
@ -41,13 +41,7 @@ class BoolTrue(BoolFalse):
|
||||
class Bool(Object):
|
||||
@classmethod
|
||||
def read(cls, b: BytesIO) -> bool:
|
||||
value = int.from_bytes(b.read(4), "little")
|
||||
|
||||
return (
|
||||
True if value == BoolTrue.ID
|
||||
else False if value == BoolFalse.ID
|
||||
else None
|
||||
)
|
||||
return int.from_bytes(b.read(4), "little") == BoolTrue.ID
|
||||
|
||||
def __new__(cls, value: bool) -> BoolTrue or BoolFalse:
|
||||
return BoolTrue() if value else BoolFalse()
|
||||
|
Loading…
Reference in New Issue
Block a user