Skip to content

Commit ed6956a

Browse files
authored
perf(es/minifier): Use u8 for remaining_depth (#10833)
**Description:** `u8` is enough for this field. This PR reduces the size of `ExprCtx` from 12 bytes to 8 bytes. 8 bits (64 bits) is sufficient for now.
1 parent 66ae1e8 commit ed6956a

File tree

1 file changed

+1
-1
lines changed
  • crates/swc_ecma_utils/src

1 file changed

+1
-1
lines changed

crates/swc_ecma_utils/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ pub struct ExprCtx {
705705
/// function should not operate and return the safe value.
706706
///
707707
/// Default value is `4`
708-
pub remaining_depth: u32,
708+
pub remaining_depth: u8,
709709
}
710710

711711
/// Extension methods for [Expr].

0 commit comments

Comments
 (0)