Minor change to improve readability (#3695)

This commit is contained in:
Aaron Gokaslan 2022-02-07 15:29:25 -05:00 committed by GitHub
parent 96b943be1d
commit 1b84188330
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -568,8 +568,8 @@ extern "C" inline int pybind11_getbuffer(PyObject *obj, Py_buffer *view, int fla
view->format = const_cast<char *>(info->format.c_str()); view->format = const_cast<char *>(info->format.c_str());
if ((flags & PyBUF_STRIDES) == PyBUF_STRIDES) { if ((flags & PyBUF_STRIDES) == PyBUF_STRIDES) {
view->ndim = (int) info->ndim; view->ndim = (int) info->ndim;
view->strides = &info->strides[0]; view->strides = info->strides.data();
view->shape = &info->shape[0]; view->shape = info->shape.data();
} }
Py_INCREF(view->obj); Py_INCREF(view->obj);
return 0; return 0;