@@ -181,21 +181,19 @@ macro_rules! algorithm_simd {
181
181
182
182
#[ cfg_attr( not( target_arch="aarch64" ) , target_feature( enable = $feat) ) ]
183
183
#[ inline]
184
- #[ allow( unconditional_panic) ] // does not panic because len is checked
185
- #[ allow( const_err) ] // the same, but for Rust 1.38.0
186
184
unsafe fn check_block( & mut self , input: SimdInput ) {
187
185
// WORKAROUND
188
186
// necessary because the for loop is not unrolled on ARM64
189
187
if input. vals. len( ) == 2 {
190
- self . check_bytes( input. vals[ 0 ] ) ;
191
- self . check_bytes( input. vals[ 1 ] ) ;
192
- self . incomplete = Self :: is_incomplete( input. vals[ 1 ] ) ;
188
+ self . check_bytes( * input. vals. get_unchecked ( 0 ) ) ;
189
+ self . check_bytes( * input. vals. get_unchecked ( 1 ) ) ;
190
+ self . incomplete = Self :: is_incomplete( * input. vals. get_unchecked ( 1 ) ) ;
193
191
} else if input. vals. len( ) == 4 {
194
- self . check_bytes( input. vals[ 0 ] ) ;
195
- self . check_bytes( input. vals[ 1 ] ) ;
196
- self . check_bytes( input. vals[ 2 ] ) ;
197
- self . check_bytes( input. vals[ 3 ] ) ;
198
- self . incomplete = Self :: is_incomplete( input. vals[ 3 ] ) ;
192
+ self . check_bytes( * input. vals. get_unchecked ( 0 ) ) ;
193
+ self . check_bytes( * input. vals. get_unchecked ( 1 ) ) ;
194
+ self . check_bytes( * input. vals. get_unchecked ( 2 ) ) ;
195
+ self . check_bytes( * input. vals. get_unchecked ( 3 ) ) ;
196
+ self . incomplete = Self :: is_incomplete( * input. vals. get_unchecked ( 3 ) ) ;
199
197
} else {
200
198
panic!( "Unsupported number of chunks" ) ;
201
199
}
0 commit comments