Skip to content

Commit 29ef38d

Browse files
committed
Remove unnecessary checks
1 parent f30746a commit 29ef38d

File tree

1 file changed

+1
-7
lines changed
  • pyrogram/api/core/primitives

1 file changed

+1
-7
lines changed

pyrogram/api/core/primitives/bool.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,7 @@ class BoolTrue(BoolFalse):
4141
class Bool(Object):
4242
@classmethod
4343
def read(cls, b: BytesIO) -> bool:
44-
value = int.from_bytes(b.read(4), "little")
45-
46-
return (
47-
True if value == BoolTrue.ID
48-
else False if value == BoolFalse.ID
49-
else None
50-
)
44+
return int.from_bytes(b.read(4), "little") == BoolTrue.ID
5145

5246
def __new__(cls, value: bool) -> BoolTrue or BoolFalse:
5347
return BoolTrue() if value else BoolFalse()

0 commit comments

Comments
 (0)