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 11use numpy:: PyReadonlyArray1 ;
22use pyo3:: prelude:: * ;
33use wide:: * ;
4- use pyo3:: types:: PyBool ;
5- use pyo3:: types:: PyAny ;
4+ // use pyo3::types::{PyBool, PyAny};
65
76#[ pyfunction]
87fn first_true_1d_a ( array : PyReadonlyArray1 < bool > ) -> isize {
@@ -241,15 +240,15 @@ fn first_true_1d_f(py: Python, array: PyReadonlyArray1<bool>) -> isize {
241240#[ pyo3( signature = ( array, forward=true ) ) ]
242241fn first_true_1d ( py : Python ,
243242 array : PyReadonlyArray1 < bool > ,
244- forward : & PyBool
243+ forward : bool ,
245244) -> isize {
246245 if let Ok ( slice) = array. as_slice ( ) {
247246 py. allow_threads ( || {
248247 let len = slice. len ( ) ;
249248 let ptr = slice. as_ptr ( ) as * const u8 ;
250249 let ones = u8x32:: splat ( 1 ) ;
251250
252- if forward. is_true ( ) ? {
251+ if forward {
253252 let mut i = 0 ;
254253 unsafe {
255254 // Process 32 bytes at a time with SIMD
@@ -304,7 +303,7 @@ fn first_true_1d(py: Python,
304303 } else {
305304 let array_view = array. as_array ( ) ;
306305 py. allow_threads ( || {
307- if forward. is_true ( ) ? {
306+ if forward {
308307 array_view
309308 . iter ( )
310309 . position ( |& v| v)
You can’t perform that action at this time.
0 commit comments