diff --git a/crates/oxc_semantic/src/builder.rs b/crates/oxc_semantic/src/builder.rs index 5972d86faccde..4ee232c7bfe29 100644 --- a/crates/oxc_semantic/src/builder.rs +++ b/crates/oxc_semantic/src/builder.rs @@ -268,6 +268,9 @@ impl<'a> SemanticBuilder<'a> { #[inline] fn record_ast_node(&mut self) { + // The `self.cfg.is_some()` check here could be removed, since `ast_node_records` is empty + // if CFG is disabled. But benchmarks showed removing the extra check is a perf regression. + // if self.cfg.is_some() { if let Some(record) = self.ast_node_records.last_mut() { if *record == AstNodeId::dummy() {