Remove unnecessary ToJson in td_api_json.

GitOrigin-RevId: 93dd7a4f30ad93ab32a0dabf97ce6f856dcf618a
This commit is contained in:
levlam 2019-12-23 03:32:43 +03:00
parent 674e6b79d8
commit b1314b38be
1 changed files with 6 additions and 1 deletions

View File

@ -51,7 +51,12 @@ void gen_to_json_constructor(StringBuilder &sb, const T *constructor, bool is_he
arg.type->vector_value_type->type == tl::simple::Type::Int64) {
object = PSTRING() << "JsonVectorInt64{" << object << "}";
}
sb << " jo(\"" << arg.name << "\", ToJson(" << object << "));\n";
if (arg.type->type == tl::simple::Type::Int64 || arg.type->type == tl::simple::Type::Vector ||
arg.type->type == tl::simple::Type::Custom) {
sb << " jo(\"" << arg.name << "\", ToJson(" << object << "));\n";
} else {
sb << " jo(\"" << arg.name << "\", " << object << ");\n";
}
if (is_custom) {
sb << " }\n";
}