Skip to content

Commit

Permalink
Drop unneeded check
Browse files Browse the repository at this point in the history
  • Loading branch information
jakirkham committed Jul 31, 2024
1 parent 49ee686 commit 051fe21
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions python/pybind11/cucim_py.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -460,16 +460,13 @@ py::object py_read_region(const CuImage& cuimg,
if (mv) // fast copy
{
py::buffer_info buf = buffer_info(PyMemoryView_GET_BUFFER(mv.ptr()), false);
if (buf)
if (buf.format != py::format_descriptor<int64_t>::format())
{
if (buf.format != py::format_descriptor<int64_t>::format())
{
throw std::invalid_argument("Expected int64 array-like");
}
if (PyBuffer_IsContiguous(buf.view(), 'C'))
{
throw std::invalid_argument("Expected C-contiguous array-like");
}
throw std::invalid_argument("Expected int64 array-like");
}
if (PyBuffer_IsContiguous(buf.view(), 'C'))
{
throw std::invalid_argument("Expected C-contiguous array-like");
}

int64_t* data_array = static_cast<int64_t*>(buf.ptr);
Expand Down

0 comments on commit 051fe21

Please sign in to comment.