mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 17:36:34 +03:00
Replace 4 .append calls with a single one when serializing bytes
This commit is contained in:
parent
b83cd98ba0
commit
98c2e1dd4f
|
@ -101,10 +101,12 @@ class TLObject:
|
||||||
if padding != 0:
|
if padding != 0:
|
||||||
padding = 4 - padding
|
padding = 4 - padding
|
||||||
|
|
||||||
r.append(bytes([254]))
|
r.append(bytes([
|
||||||
r.append(bytes([len(data) % 256]))
|
254,
|
||||||
r.append(bytes([(len(data) >> 8) % 256]))
|
len(data) % 256,
|
||||||
r.append(bytes([(len(data) >> 16) % 256]))
|
(len(data) >> 8) % 256,
|
||||||
|
(len(data) >> 16) % 256
|
||||||
|
]))
|
||||||
r.append(data)
|
r.append(data)
|
||||||
|
|
||||||
r.append(bytes(padding))
|
r.append(bytes(padding))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user