diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2020-08-02 15:22:17 +0200 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2020-08-02 15:22:17 +0200 |
commit | 4c02adc906a55cd5ac663b2bb62418cf1132092f (patch) | |
tree | 92a81d3204356817d4e1482e94ac992c3fd59a6c | |
parent | 343262aed8b329c9105900df5f35a1a43eba8655 (diff) | |
download | cython-4c02adc906a55cd5ac663b2bb62418cf1132092f.tar.gz |
Do not depend on the default type inference in "cpython/array.pxd".
-rw-r--r-- | Cython/Includes/cpython/array.pxd | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Cython/Includes/cpython/array.pxd b/Cython/Includes/cpython/array.pxd index 3d2bb05e4..19230a0a8 100644 --- a/Cython/Includes/cpython/array.pxd +++ b/Cython/Includes/cpython/array.pxd @@ -131,14 +131,14 @@ cdef inline array clone(array template, Py_ssize_t length, bint zero): """ fast creation of a new array, given a template array. type will be same as template. if zero is true, new array will be initialized with zeroes.""" - op = newarrayobject(Py_TYPE(template), length, template.ob_descr) + cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr) if zero and op is not None: memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) return op cdef inline array copy(array self): """ make a copy of an array. """ - op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) + cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize) return op |