Skip to content

Commit

Permalink
fix optimization of all-bits mask check
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiosantoscode committed Mar 6, 2024
1 parent 7cab6e8 commit dc02fb5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/compress/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2310,7 +2310,7 @@ def_optimize(AST_Binary, function(self, compressor) {
operator: "~",
expression: x
})
}), self.operator[0] === "=");
}), self.operator[0] === "!");

return best_of(compressor, optimized, self);
}
Expand Down
4 changes: 2 additions & 2 deletions test/compress/evaluate.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ bitwise: {
const test11_2 = !(bar & 7)
const test11_2_rev = !(bar & 7)
if (a & b) c()
const test12 = !(7 & ~bar)
const test12_rev = !!(7 & ~bar)
const test12 = !!(7 & ~bar)
const test12_rev = !(7 & ~bar)

const test13 = bar | 0;
const test13_2 = ~bar;
Expand Down

0 comments on commit dc02fb5

Please sign in to comment.