File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 1
1
use numpy:: PyReadonlyArray1 ;
2
2
use pyo3:: prelude:: * ;
3
3
use wide:: * ;
4
- use pyo3:: types:: PyBool ;
5
- use pyo3:: types:: PyAny ;
4
+ // use pyo3::types::{PyBool, PyAny};
6
5
7
6
#[ pyfunction]
8
7
fn first_true_1d_a ( array : PyReadonlyArray1 < bool > ) -> isize {
@@ -241,15 +240,15 @@ fn first_true_1d_f(py: Python, array: PyReadonlyArray1<bool>) -> isize {
241
240
#[ pyo3( signature = ( array, forward=true ) ) ]
242
241
fn first_true_1d ( py : Python ,
243
242
array : PyReadonlyArray1 < bool > ,
244
- forward : & PyBool
243
+ forward : bool ,
245
244
) -> isize {
246
245
if let Ok ( slice) = array. as_slice ( ) {
247
246
py. allow_threads ( || {
248
247
let len = slice. len ( ) ;
249
248
let ptr = slice. as_ptr ( ) as * const u8 ;
250
249
let ones = u8x32:: splat ( 1 ) ;
251
250
252
- if forward. is_true ( ) ? {
251
+ if forward {
253
252
let mut i = 0 ;
254
253
unsafe {
255
254
// Process 32 bytes at a time with SIMD
@@ -304,7 +303,7 @@ fn first_true_1d(py: Python,
304
303
} else {
305
304
let array_view = array. as_array ( ) ;
306
305
py. allow_threads ( || {
307
- if forward. is_true ( ) ? {
306
+ if forward {
308
307
array_view
309
308
. iter ( )
310
309
. position ( |& v| v)
You can’t perform that action at this time.
0 commit comments