Skip to content

Commit

Permalink
Minor readability refactoring
Browse files Browse the repository at this point in the history
Summary: Minor refactoring

Reviewed By: iahs

Differential Revision: D67545998

fbshipit-source-id: e4faedf4cf81ce5a4eed710c8388f0237327ec6b
  • Loading branch information
yoney authored and facebook-github-bot committed Dec 21, 2024
1 parent 37fbbfe commit bfb2899
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
12 changes: 2 additions & 10 deletions thrift/compiler/generate/mstch_objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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(); }

Expand Down
3 changes: 1 addition & 2 deletions thrift/compiler/generate/t_mstch_cpp2_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<const t_list*>(next)->get_elem_type());
} else if (next->is_set()) {
queue.push(static_cast<const t_set*>(next)->get_elem_type());
Expand Down

0 comments on commit bfb2899

Please sign in to comment.