Skip to content

Commit

Permalink
Remove unused-but-set variables in thrift/compiler/generate/t_mstch_j…
Browse files Browse the repository at this point in the history
…ava_generator.cc +1

Summary:
Required for LLVM-19 upgrade.

This diff removes a variable that was set, but which was not used.

LLVM-19 has a warning `-Wunused-but-set-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused but set variables often indicate a programming mistake, but can also just be unnecessary cruft that harms readability and performance.

Removing this variable will not change how your code works, but the unused variable may indicate your code isn't working the way you thought it was. If you feel the diff needs changes before landing, **please commandeer** and make appropriate changes: there are hundreds of these and responding to them individually is challenging.

For questions/comments, contact r-barnes.

 - If you approve of this diff, please use the "Accept & Ship" button :-)

Reviewed By: palmje

Differential Revision: D64996202

fbshipit-source-id: 964b99a1a06cce2ac4e959e6a56daeb0d2f2d857
  • Loading branch information
r-barnes authored and facebook-github-bot committed Oct 26, 2024
1 parent 5418c75 commit 5ade17a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions thrift/compiler/generate/t_mstch_java_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ class mstch_java_field : public mstch_field {
bool _has_type_adapter() {
auto type = field_->get_type();
if (type->is_typedef()) {
if (auto annotation = t_typedef::get_first_structured_annotation_or_null(
if (t_typedef::get_first_structured_annotation_or_null(
type, kJavaAdapterUri)) {
return true;
}
Expand Down Expand Up @@ -1310,8 +1310,7 @@ class mstch_java_type : public mstch_type {

mstch::node has_structured_annotation(const char* uri) {
if (type_->is_typedef()) {
if (auto annotation =
t_typedef::get_first_structured_annotation_or_null(type_, uri)) {
if (t_typedef::get_first_structured_annotation_or_null(type_, uri)) {
return true;
}
}
Expand Down

0 comments on commit 5ade17a

Please sign in to comment.