Skip to content

Commit

Permalink
perf(syntax): make AstNodeId::dummy const
Browse files Browse the repository at this point in the history
  • Loading branch information
rzvxa committed Jul 16, 2024
1 parent 3416099 commit cb215f7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crates/oxc_syntax/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ define_index_type! {
pub struct AstNodeId = u32;
}

const AST_NODE_ID_DUMMY: AstNodeId = AstNodeId::from_raw_unchecked(0);

impl AstNodeId {
#[inline]
pub fn dummy() -> Self {
Self::new(0)
pub const fn dummy() -> Self {
AST_NODE_ID_DUMMY
}
}

Expand Down

0 comments on commit cb215f7

Please sign in to comment.