Skip to content

Commit

Permalink
perf(transformer/react): improve is_componentish_name's implementat…
Browse files Browse the repository at this point in the history
…ion (#5769)
  • Loading branch information
Dunqing committed Sep 13, 2024
1 parent 3cc38df commit aac8316
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/oxc_transformer/src/react/refresh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ impl<'a> ReactRefresh<'a> {
}

fn is_componentish_name(name: &str) -> bool {
name.chars().next().unwrap().is_ascii_uppercase()
name.as_bytes().first().is_some_and(u8::is_ascii_uppercase)
}

fn is_use_hook_name(name: &str) -> bool {
Expand Down

0 comments on commit aac8316

Please sign in to comment.