File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -252,12 +252,12 @@ const fn next_state(st: u32, byte: u8) -> u32 {
252
252
253
253
#[ cfg( any( target_pointer_width = "16" , target_pointer_width = "32" ) ) ]
254
254
#[ inline( always) ]
255
- fn next_state ( st : u32 , byte : u8 ) -> u32 {
255
+ const fn next_state ( st : u32 , byte : u8 ) -> u32 {
256
256
// SAFETY: `u64` is more aligned than `u32`, and has the same repr as `[u32; 2]`.
257
- let [ lo, hi] = unsafe { std :: mem:: transmute :: < u64 , [ u32 ; 2 ] > ( TRANS_TABLE [ byte as usize ] ) } ;
257
+ let [ lo, hi] = unsafe { crate :: mem:: transmute :: < u64 , [ u32 ; 2 ] > ( TRANS_TABLE [ byte as usize ] ) } ;
258
258
#[ cfg( target_endian = "big" ) ]
259
259
let ( lo, hi) = ( hi, lo) ;
260
- ( st & 32 == 0 ) . select_unpredictable ( lo , hi ) . wrapping_shr ( st)
260
+ if st & 32 == 0 { lo } else { hi } . wrapping_shr ( st)
261
261
}
262
262
263
263
/// Check if `byte` is a valid UTF-8 first byte, assuming it must be a valid first or
You can’t perform that action at this time.
0 commit comments