You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generated Telegram API methods implementation can reserve the exact amount of memory in the output byte array.
The generated code should be readable, so:
The size calculation code line length should be limited to 120 symbols
It's OK for Strings and ByteArrays to treat length bytes as 4 (better than use ternary operators)
The addendums (except Strings and ByteArrays) should have inline comments (TLValue constant name for functions, argument/member name in all other cases; size bytes should be decorated as "4 /* size bytes */")
Commits:
Introduce sizeInBytes() const methods for all TLTypes
Introduce output.reserve() generation for all methods
Bonus:
Make sizeInBytes() constexpr if possible:
The type has only one tlType value
The type has no complex or Strings/ByteArrays members
Generated Telegram API methods implementation can reserve the exact amount of memory in the output byte array.
The generated code should be readable, so:
Commits:
Bonus:
Expected diff would look like:
The text was updated successfully, but these errors were encountered: