diff --git a/third-party/thrift/src/thrift/compiler/generate/mstch_objects.h b/third-party/thrift/src/thrift/compiler/generate/mstch_objects.h index 920362c32c6e9..95a8aacabf1a8 100644 --- a/third-party/thrift/src/thrift/compiler/generate/mstch_objects.h +++ b/third-party/thrift/src/thrift/compiler/generate/mstch_objects.h @@ -1179,11 +1179,7 @@ class mstch_field : public mstch_base { return item.second->get_integer() == action; } } - if (action == def && annotation->value()->get_map().size() == 0) { - return true; - } - - return false; + return action == def && annotation->value()->get_map().empty(); } protected: @@ -1267,11 +1263,7 @@ class mstch_enum : public mstch_base { return item.second->get_integer() == action; } } - if (action == def && annotation->value()->get_map().size() == 0) { - return true; - } - - return false; + return action == def && annotation->value()->get_map().empty(); } mstch::node thrift_uri() { return enum_->uri(); } diff --git a/third-party/thrift/src/thrift/compiler/generate/t_mstch_cpp2_generator.cc b/third-party/thrift/src/thrift/compiler/generate/t_mstch_cpp2_generator.cc index 77151cc0e6f4d..05359433db8a6 100644 --- a/third-party/thrift/src/thrift/compiler/generate/t_mstch_cpp2_generator.cc +++ b/third-party/thrift/src/thrift/compiler/generate/t_mstch_cpp2_generator.cc @@ -1162,8 +1162,7 @@ class cpp_mstch_type : public mstch_type { if (!next->is_container()) { continue; } - if (false) { - } else if (next->is_list()) { + if (next->is_list()) { queue.push(static_cast(next)->get_elem_type()); } else if (next->is_set()) { queue.push(static_cast(next)->get_elem_type());