File tree Expand file tree Collapse file tree 2 files changed +4
-16
lines changed
src/tools/unicode-table-generator/src Expand file tree Collapse file tree 2 files changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -94,10 +94,7 @@ unsafe fn skip_search<const SOR: usize, const OFFSETS: usize>(
94
94
// correct location cannot be past it, so `Err(idx) => idx != length` either.
95
95
//
96
96
// This means that we can avoid bounds checking for the accesses below, too.
97
- //
98
- // We need to use `intrinsics::assume` since the `panic_nounwind` contained
99
- // in `hint::assert_unchecked` may not be optimized out.
100
- unsafe { crate :: intrinsics:: assume ( last_idx < SOR ) } ;
97
+ unsafe { crate :: hint:: assert_unchecked ( last_idx < SOR ) } ;
101
98
102
99
let mut offset_idx = short_offset_runs[ last_idx] . start_index ( ) ;
103
100
let length = if let Some ( next) = short_offset_runs. get ( last_idx + 1 ) {
@@ -115,10 +112,7 @@ unsafe fn skip_search<const SOR: usize, const OFFSETS: usize>(
115
112
// SAFETY: It is guaranteed that `length <= OFFSETS - offset_idx`,
116
113
// so it follows that `length - 1 + offset_idx < OFFSETS`, therefore
117
114
// `offset_idx < OFFSETS` is always true in this loop.
118
- //
119
- // We need to use `intrinsics::assume` since the `panic_nounwind` contained
120
- // in `hint::assert_unchecked` may not be optimized out.
121
- unsafe { crate :: intrinsics:: assume ( offset_idx < OFFSETS ) } ;
115
+ unsafe { crate :: hint:: assert_unchecked ( offset_idx < OFFSETS ) } ;
122
116
let offset = offsets[ offset_idx] ;
123
117
prefix_sum += offset as u32 ;
124
118
if prefix_sum > total {
Original file line number Diff line number Diff line change @@ -92,10 +92,7 @@ unsafe fn skip_search<const SOR: usize, const OFFSETS: usize>(
92
92
// correct location cannot be past it, so `Err(idx) => idx != length` either.
93
93
//
94
94
// This means that we can avoid bounds checking for the accesses below, too.
95
- //
96
- // We need to use `intrinsics::assume` since the `panic_nounwind` contained
97
- // in `hint::assert_unchecked` may not be optimized out.
98
- unsafe { crate :: intrinsics:: assume ( last_idx < SOR ) } ;
95
+ unsafe { crate :: hint:: assert_unchecked ( last_idx < SOR ) } ;
99
96
100
97
let mut offset_idx = short_offset_runs[ last_idx] . start_index ( ) ;
101
98
let length = if let Some ( next) = short_offset_runs. get ( last_idx + 1 ) {
@@ -113,10 +110,7 @@ unsafe fn skip_search<const SOR: usize, const OFFSETS: usize>(
113
110
// SAFETY: It is guaranteed that `length <= OFFSETS - offset_idx`,
114
111
// so it follows that `length - 1 + offset_idx < OFFSETS`, therefore
115
112
// `offset_idx < OFFSETS` is always true in this loop.
116
- //
117
- // We need to use `intrinsics::assume` since the `panic_nounwind` contained
118
- // in `hint::assert_unchecked` may not be optimized out.
119
- unsafe { crate :: intrinsics:: assume ( offset_idx < OFFSETS ) } ;
113
+ unsafe { crate :: hint:: assert_unchecked ( offset_idx < OFFSETS ) } ;
120
114
let offset = offsets[ offset_idx] ;
121
115
prefix_sum += offset as u32 ;
122
116
if prefix_sum > total {
You can’t perform that action at this time.
0 commit comments