From 3cdc47cb0dc5f028d38870e69d19e958e739320b Mon Sep 17 00:00:00 2001 From: overlookmotel <557937+overlookmotel@users.noreply.github.com> Date: Wed, 11 Dec 2024 14:54:48 +0000 Subject: [PATCH] refactor(transformer/class-properties): `#[inline(always)]` on `assert_expr_neither_parenthesis_nor_typescript_syntax` (#7802) Follow-on after #7795. Add `#[inline(always)]` to this function which is no-op in release mode, to make absolutely sure it gets optimized out in full. --- crates/oxc_transformer/src/es2022/class_properties/utils.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/oxc_transformer/src/es2022/class_properties/utils.rs b/crates/oxc_transformer/src/es2022/class_properties/utils.rs index 923a5af3a3d96..082472d397ffd 100644 --- a/crates/oxc_transformer/src/es2022/class_properties/utils.rs +++ b/crates/oxc_transformer/src/es2022/class_properties/utils.rs @@ -56,7 +56,9 @@ pub(super) fn create_underscore_ident_name<'a>(ctx: &mut TraverseCtx<'a>) -> Ide ctx.ast.identifier_name(SPAN, Atom::from("_")) } -#[inline] +// `#[inline(always)]` because this is a no-op in release mode +#[expect(clippy::inline_always)] +#[inline(always)] pub(super) fn assert_expr_neither_parenthesis_nor_typescript_syntax( expr: &Expression, path: &PathBuf,