Skip to content

Commit 4eab8e8

Browse files
authored
perf(es/minifier): Make get_type for === lazy (#10920)
1 parent 400c996 commit 4eab8e8

File tree

1 file changed

+2
-5
lines changed
  • crates/swc_ecma_minifier/src/compress/optimize

1 file changed

+2
-5
lines changed

crates/swc_ecma_minifier/src/compress/optimize/ops.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,9 @@ impl Optimizer<'_> {
5656
}
5757
}
5858

59-
let lt = e.left.get_type(self.ctx.expr_ctx);
60-
let rt = e.right.get_type(self.ctx.expr_ctx);
61-
6259
if e.op == op!("===") {
63-
if let Known(lt) = lt {
64-
if let Known(rt) = rt {
60+
if let Known(lt) = e.left.get_type(self.ctx.expr_ctx) {
61+
if let Known(rt) = e.right.get_type(self.ctx.expr_ctx) {
6562
if lt == rt {
6663
e.op = op!("==");
6764
self.changed = true;

0 commit comments

Comments
 (0)