Skip to content

Commit

Permalink
Remove unused variables in fbpcs/emp_games/pcf2_shard_combiner/util/A…
Browse files Browse the repository at this point in the history
…ggMetricsThresholdCheckers_impl.h

Summary:
LLVM-15 has a warning `-Wunused-but-set-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused variables can compromise readability or, worse, performance.

This diff either (a) removes an unused variable and, possibly, it's associated code, or (b) qualifies the variable with `[[maybe_unused]]`, mostly in cases where the variable _is_ used, but, eg, in an `assert` statement that isn't present in production code.

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

Reviewed By: danzimm, meyering

Differential Revision: D52849677
  • Loading branch information
r-barnes authored and facebook-github-bot committed Jan 18, 2024
1 parent 5c36e44 commit a02dcec
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ checkThresholdAndUpdateMetric(
return getGroupLiftChecker<schedulerId, usingBatch, inputEncryption>(
threshold, sentinelVal);
} else {
return [threshold, sentinelVal](
AggMetrics_sp<schedulerId, usingBatch, inputEncryption>) {
// for any other type do nothing.
XLOG(WARN) << "Threshold: " << threshold << " is unused";
};
return
[threshold](AggMetrics_sp<schedulerId, usingBatch, inputEncryption>) {
// for any other type do nothing.
XLOG(WARN) << "Threshold: " << threshold << " is unused";
};
}
}

Expand Down

0 comments on commit a02dcec

Please sign in to comment.