diff --git a/Modules/Bridge/NumPy/include/itkPyBuffer.hxx b/Modules/Bridge/NumPy/include/itkPyBuffer.hxx index a9b9524b6b2..b4354ef8f72 100644 --- a/Modules/Bridge/NumPy/include/itkPyBuffer.hxx +++ b/Modules/Bridge/NumPy/include/itkPyBuffer.hxx @@ -58,9 +58,7 @@ PyBuffer::_GetArrayViewFromImage(ImageType * image) len *= sizeof(ComponentType); PyBuffer_FillInfo(&pyBuffer, nullptr, itkImageBuffer, len, 0, PyBUF_CONTIG); - PyObject * const memoryView = PyMemoryView_FromBuffer(&pyBuffer); - - return memoryView; + return PyMemoryView_FromBuffer(&pyBuffer); } template diff --git a/Modules/Bridge/NumPy/include/itkPyVectorContainer.hxx b/Modules/Bridge/NumPy/include/itkPyVectorContainer.hxx index d432ece80db..2ec4d54a3ce 100644 --- a/Modules/Bridge/NumPy/include/itkPyVectorContainer.hxx +++ b/Modules/Bridge/NumPy/include/itkPyVectorContainer.hxx @@ -44,9 +44,7 @@ PyVectorContainer::_array_view_from_vector_contain len *= sizeof(DataType); PyBuffer_FillInfo(&pyBuffer, nullptr, vectorBuffer, len, 0, PyBUF_CONTIG); - PyObject * const memoryView = PyMemoryView_FromBuffer(&pyBuffer); - - return memoryView; + return PyMemoryView_FromBuffer(&pyBuffer); } template diff --git a/Modules/Bridge/NumPy/include/itkPyVnl.hxx b/Modules/Bridge/NumPy/include/itkPyVnl.hxx index b62124f306f..7f4e417b549 100644 --- a/Modules/Bridge/NumPy/include/itkPyVnl.hxx +++ b/Modules/Bridge/NumPy/include/itkPyVnl.hxx @@ -44,9 +44,7 @@ PyVnl::_GetArrayViewFromVnlVector(VectorType * vector) len *= sizeof(DataType); PyBuffer_FillInfo(&pyBuffer, nullptr, vectorBuffer, len, 0, PyBUF_CONTIG); - PyObject * const memoryView = PyMemoryView_FromBuffer(&pyBuffer); - - return memoryView; + return PyMemoryView_FromBuffer(&pyBuffer); } template @@ -103,9 +101,7 @@ PyVnl::_GetArrayViewFromVnlMatrix(MatrixType * matrix) len *= sizeof(DataType); PyBuffer_FillInfo(&pyBuffer, nullptr, matrixBuffer, len, 0, PyBUF_CONTIG); - PyObject * const memoryView = PyMemoryView_FromBuffer(&pyBuffer); - - return memoryView; + return PyMemoryView_FromBuffer(&pyBuffer); } template