@@ -3012,6 +3012,7 @@ impl<T: AsRef<[u32]>> DFA<T> {
3012
3012
/// Returns the index of the match state for the given ID. If the
3013
3013
/// given ID does not correspond to a match state, then this may
3014
3014
/// panic or produce an incorrect result.
3015
+ #[ cfg_attr( feature = "perf-inline" , inline( always) ) ]
3015
3016
fn match_state_index ( & self , id : StateID ) -> usize {
3016
3017
debug_assert ! ( self . is_match_state( id) ) ;
3017
3018
// This is one of the places where we rely on the fact that match
@@ -4599,6 +4600,7 @@ impl<T: AsRef<[u32]>> MatchStates<T> {
4599
4600
///
4600
4601
/// The match index is the index of the pattern ID for the given state.
4601
4602
/// The index must be less than `self.pattern_len(state_index)`.
4603
+ #[ cfg_attr( feature = "perf-inline" , inline( always) ) ]
4602
4604
fn pattern_id ( & self , state_index : usize , match_index : usize ) -> PatternID {
4603
4605
self . pattern_id_slice ( state_index) [ match_index]
4604
4606
}
@@ -4607,6 +4609,7 @@ impl<T: AsRef<[u32]>> MatchStates<T> {
4607
4609
///
4608
4610
/// The match state index is the state index minus the state index of the
4609
4611
/// first match state in the DFA.
4612
+ #[ cfg_attr( feature = "perf-inline" , inline( always) ) ]
4610
4613
fn pattern_len ( & self , state_index : usize ) -> usize {
4611
4614
self . slices ( ) [ state_index * 2 + 1 ] . as_usize ( )
4612
4615
}
@@ -4615,24 +4618,28 @@ impl<T: AsRef<[u32]>> MatchStates<T> {
4615
4618
///
4616
4619
/// The match state index is the state index minus the state index of the
4617
4620
/// first match state in the DFA.
4621
+ #[ cfg_attr( feature = "perf-inline" , inline( always) ) ]
4618
4622
fn pattern_id_slice ( & self , state_index : usize ) -> & [ PatternID ] {
4619
4623
let start = self . slices ( ) [ state_index * 2 ] . as_usize ( ) ;
4620
4624
let len = self . pattern_len ( state_index) ;
4621
4625
& self . pattern_ids ( ) [ start..start + len]
4622
4626
}
4623
4627
4624
4628
/// Returns the pattern ID offset slice of u32 as a slice of PatternID.
4629
+ #[ cfg_attr( feature = "perf-inline" , inline( always) ) ]
4625
4630
fn slices ( & self ) -> & [ PatternID ] {
4626
4631
wire:: u32s_to_pattern_ids ( self . slices . as_ref ( ) )
4627
4632
}
4628
4633
4629
4634
/// Returns the total number of match states.
4635
+ #[ cfg_attr( feature = "perf-inline" , inline( always) ) ]
4630
4636
fn len ( & self ) -> usize {
4631
4637
assert_eq ! ( 0 , self . slices( ) . len( ) % 2 ) ;
4632
4638
self . slices ( ) . len ( ) / 2
4633
4639
}
4634
4640
4635
4641
/// Returns the pattern ID slice of u32 as a slice of PatternID.
4642
+ #[ cfg_attr( feature = "perf-inline" , inline( always) ) ]
4636
4643
fn pattern_ids ( & self ) -> & [ PatternID ] {
4637
4644
wire:: u32s_to_pattern_ids ( self . pattern_ids . as_ref ( ) )
4638
4645
}
0 commit comments