mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-16 04:35:24 +00:00
Various improvements
This commit is contained in:
parent
1a4cb86a16
commit
3ea48899f4
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user