From 29ef38df89bb3f92b96f358dd03e52d022d5df85 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Wed, 6 Dec 2017 19:14:45 +0100 Subject: [PATCH] Remove unnecessary checks --- pyrogram/api/core/primitives/bool.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pyrogram/api/core/primitives/bool.py b/pyrogram/api/core/primitives/bool.py index 1e011543..1c08c839 100644 --- a/pyrogram/api/core/primitives/bool.py +++ b/pyrogram/api/core/primitives/bool.py @@ -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()