Skip to content

Commit

Permalink
Remove unused variables in fbpcs/emp_games/lift/pcf2_calculator/test/…
Browse files Browse the repository at this point in the history
…common/LiftCalculator.cpp (#2398)

Summary:
Pull Request resolved: #2398

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: palmje

Differential Revision: D56022428

fbshipit-source-id: 56074bd3d9cbfcc91c97072bbe50b8e306ff3afe
  • Loading branch information
r-barnes authored and facebook-github-bot committed Apr 12, 2024
1 parent 2368e5d commit a035f09
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,6 @@ GroupedLiftMetrics LiftCalculator::compute(
}

if (opportunity && opportunityTimestamp > 0) {
uint64_t value_subsum = 0;
uint64_t convCount = 0;
bool converted = false;
bool countedMatchAlready = false;
if (testFlag) {
updateTestMetrics(
groupedLiftMetrics,
Expand Down
10 changes: 0 additions & 10 deletions fbpcs/emp_games/pcf2_aggregation/AggregationGame_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,6 @@ AggregationOutputMetrics AggregationGame<schedulerId>::computeAggregations(

const int8_t indicatorSumWidth = adIdWidth;
bool isPublisher = (myRole == common::PUBLISHER);
auto oramRole = isPublisher
? fbpcf::mpc_std_lib::oram::IWriteOnlyOram<
fbpcf::mpc_std_lib::util::AggregationValue>::Alice
: fbpcf::mpc_std_lib::oram::IWriteOnlyOram<
fbpcf::mpc_std_lib::util::AggregationValue>::Bob;

PrivateAggregationMetrics<schedulerId> aggregationMetrics{
aggregationFormats,
Expand Down Expand Up @@ -294,11 +289,6 @@ AggregationGame<schedulerId>::computeAggregationsReformatted(

const int64_t indicatorSumWidth = adIdWidth;
bool isPublisher = (myRole == common::PUBLISHER);
auto oramRole = isPublisher
? fbpcf::mpc_std_lib::oram::IWriteOnlyOram<
fbpcf::mpc_std_lib::util::AggregationValue>::Alice
: fbpcf::mpc_std_lib::oram::IWriteOnlyOram<
fbpcf::mpc_std_lib::util::AggregationValue>::Bob;

PrivateAggregationMetrics<schedulerId> aggregationMetrics{
aggregationFormats,
Expand Down

0 comments on commit a035f09

Please sign in to comment.