Skip to content

Commit a5c35d6

Browse files
committed
cleanup up arg passing
1 parent 7f093c5 commit a5c35d6

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/lib.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
use numpy::PyReadonlyArray1;
22
use pyo3::prelude::*;
33
use wide::*;
4-
use pyo3::types::PyBool;
5-
use pyo3::types::PyAny;
4+
// use pyo3::types::{PyBool, PyAny};
65

76
#[pyfunction]
87
fn 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))]
242241
fn 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)

0 commit comments

Comments
 (0)