Various improvements

This commit is contained in:
KurimuzonAkuma 2024-02-16 17:35:40 +03:00
parent 1a4cb86a16
commit 3ea48899f4

View File

@ -33,17 +33,13 @@ class Vector(bytes, TLObject):
@staticmethod @staticmethod
def read_bare(b: BytesIO, size: int) -> Union[int, Any]: def read_bare(b: BytesIO, size: int) -> Union[int, Any]:
if size == 4: if size == 4:
e = int.from_bytes( e = int.from_bytes(b.read(4), "little")
b.read(4),
"little"
)
b.seek(-4, 1) b.seek(-4, 1)
if e in (BoolFalse.ID, BoolTrue.ID): if e in {BoolFalse.ID, BoolTrue.ID}:
return Bool.read(b) return Bool.read(b)
else:
return Int.read(b) return Int.read(b)
if size == 8: if size == 8:
return Long.read(b) return Long.read(b)