Skip to content

Commit

Permalink
Fix '-Wbitwise-instead-of-logical' in fbpcs/emp_games/lift/pcf2_calcu…
Browse files Browse the repository at this point in the history
…lator/input_processing/CompactionBasedInputProcessor_impl.h

Summary:
LLVM-15 requires that we differentiate between `&&` and `&` as well as `||` and `|`. Logical operations are done with `&&` and `||` and bitwise operations are done with `&` and `|`. Confusing the two makes code harder to read and may lead to subtle bugs.

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

Reviewed By: dmm-fb

Differential Revision: D42374520

fbshipit-source-id: 1b1427ebfe1ec2645ba06aec8fc955f46e13dfbc
  • Loading branch information
r-barnes authored and facebook-github-bot committed Jan 6, 2023
1 parent 393567e commit 2fb6a8e
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,11 @@ CompactionBasedInputProcessor<schedulerId>::preparePlaintextData(
int inputIndex = reverseUnionMap[i];

bool isValidOpportunityTimestamp =
(opportunityTimestampsPadded.at(inputIndex) > 0) &
(controlPopulationPadded.at(inputIndex) |
(opportunityTimestampsPadded.at(inputIndex) > 0) &&
(controlPopulationPadded.at(inputIndex) ||
testPopulationPadded.at(inputIndex));

bool testReach = testPopulationPadded.at(inputIndex) &
bool testReach = testPopulationPadded.at(inputIndex) &&
(numImpressionsPadded.at(inputIndex) > 0);

PublisherRow publisherRow{
Expand Down

0 comments on commit 2fb6a8e

Please sign in to comment.