Skip to content

Commit

Permalink
refactor(parser): adjust function inlining (#4530)
Browse files Browse the repository at this point in the history
These 2 `#[inline(always)]` were introduced by accident by me just playing around in #4298. One should be kept, but the other one we should leave to compiler to decide.
  • Loading branch information
overlookmotel committed Jul 29, 2024
1 parent 1fd9dd0 commit 148bdb5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions crates/oxc_parser/src/lexer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ impl<'a> Lexer<'a> {

/// Peek the next byte, and advance the current position if it matches
/// the given ASCII char.
// `#[inline(always)]` to make sure the `assert!` gets optimized out.
#[allow(clippy::inline_always)]
#[inline(always)]
fn next_ascii_char_eq(&mut self, b: u8) -> bool {
Expand Down
3 changes: 1 addition & 2 deletions crates/oxc_parser/src/lexer/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,7 @@ impl<'a> Source<'a> {
/// # SAFETY
///
/// Caller must ensure that `ascii_byte` is a valid ASCII character.
#[allow(clippy::inline_always)]
#[inline(always)]
#[inline]
pub(super) unsafe fn advance_if_ascii_eq(&mut self, ascii_byte: u8) -> bool {
debug_assert!(ascii_byte.is_ascii());
let matched = self.peek_byte() == Some(ascii_byte);
Expand Down

0 comments on commit 148bdb5

Please sign in to comment.