Skip to content

Commit

Permalink
Don't look up length if CFG disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Sep 11, 2024
1 parent e26f028 commit ab9a845
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions crates/oxc_semantic/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,13 @@ impl<'a> SemanticBuilder<'a> {
}

#[inline]
#[allow(clippy::cast_possible_truncation)]
fn get_next_node_index(&mut self) -> u32 {
self.nodes.len() as u32
#[allow(clippy::cast_possible_truncation)]
if self.cfg.is_some() {
self.nodes.len() as u32
} else {
0
}
}

#[inline]
Expand Down

0 comments on commit ab9a845

Please sign in to comment.