Remove TlStoreTrue.

This commit is contained in:
levlam 2021-11-01 20:02:24 +03:00
parent 6e8a88be35
commit 0522ba178a
2 changed files with 10 additions and 10 deletions

View File

@ -25,7 +25,7 @@ std::string TD_TL_writer_cpp::gen_output_begin() const {
"#include \"td/utils/logging.h\"\n" "#include \"td/utils/logging.h\"\n"
"#include \"td/utils/SliceBuilder.h\"\n" "#include \"td/utils/SliceBuilder.h\"\n"
"#include \"td/utils/tl_parsers.h\"\n" "#include \"td/utils/tl_parsers.h\"\n"
"#include \"td/utils/tl_storers.h\"\n\n" "#include \"td/utils/tl_storers.h\"\n"
"#include \"td/utils/TlStorerToString.h\"\n\n" "#include \"td/utils/TlStorerToString.h\"\n\n"
"namespace td {\n" "namespace td {\n"
"namespace " + "namespace " +
@ -324,7 +324,8 @@ std::string TD_TL_writer_cpp::gen_store_class_name(const tl::tl_tree_type *tree_
return "TlStoreBool"; return "TlStoreBool";
} }
if (name == "True") { if (name == "True") {
return "TlStoreTrue"; assert(false);
return "";
} }
if (name == "String" || name == "Bytes") { if (name == "String" || name == "Bytes") {
return "TlStoreString"; return "TlStoreString";
@ -438,6 +439,13 @@ std::string TD_TL_writer_cpp::gen_field_store(const tl::arg &a, std::vector<tl::
return ""; return "";
} }
if (a.exist_var_num >= 0 && a.var_num < 0 && a.type->get_type() == tl::NODE_TYPE_TYPE) {
const tl::tl_tree_type *tree_type = static_cast<tl::tl_tree_type *>(a.type);
if (tree_type->type->name == "True") {
return "";
}
}
if (a.exist_var_num >= 0) { if (a.exist_var_num >= 0) {
assert(a.exist_var_num < static_cast<int>(vars.size())); assert(a.exist_var_num < static_cast<int>(vars.size()));
assert(vars[a.exist_var_num].is_stored); assert(vars[a.exist_var_num].is_stored);

View File

@ -47,14 +47,6 @@ class TlStoreBool {
} }
}; };
class TlStoreTrue {
public:
template <class StorerT>
static void store(const bool &x, StorerT &storer) {
// currently nothing to do
}
};
class TlStoreBinary { class TlStoreBinary {
public: public:
template <class T, class StorerT> template <class T, class StorerT>