Remove unneeded string literal additions.

This commit is contained in:
levlam 2023-06-26 19:51:04 +03:00
parent fcf462b255
commit 1217128a50
3 changed files with 8 additions and 7 deletions

View File

@ -191,17 +191,18 @@ std::string TD_TL_writer_java::gen_int_const(const tl::tl_tree *tree_c,
}
std::string TD_TL_writer_java::gen_output_begin(const std::string &additional_imports) const {
return "package " + package_name + ";\n\n";
return "package " + package_name +
";\n\n"
"public class " +
tl_name + " {\n";
}
std::string TD_TL_writer_java::gen_output_begin_once() const {
return "public class " + tl_name +
" {\n"
" static {\n"
return " static {\n"
" try {\n"
" System.loadLibrary(\"tdjni\");\n"
" } catch (UnsatisfiedLinkError e) {\n"
" e.printStackTrace();\n" +
" e.printStackTrace();\n"
" }\n"
" }\n\n"
" private " +

View File

@ -437,7 +437,7 @@ std::string TD_TL_writer_jni_cpp::gen_fetch_function_result_begin(const std::str
const tl::tl_tree *result) const {
return "\n" + class_name + "::ReturnType " + class_name + "::fetch_result(" + parser_name +
" &p) {\n"
" if (p == nullptr) return ReturnType();\n" +
" if (p == nullptr) return ReturnType();\n"
" return ";
}

View File

@ -99,7 +99,7 @@ std::string TD_TL_writer_jni_h::gen_class_begin(const std::string &class_name, c
" virtual ~" +
class_name +
"() {\n"
" }\n\n" +
" }\n\n"
" virtual void store(JNIEnv *env, jobject &s) const {\n"
" }\n\n"
" virtual void store(TlStorerToString &s, const char *field_name) const = 0;\n\n"