summaryrefslogtreecommitdiffstats
path: root/contrib/tools/cython/Cython/Utility/arrayarray.h
diff options
context:
space:
mode:
authororivej <[email protected]>2022-02-10 16:44:49 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:44:49 +0300
commit718c552901d703c502ccbefdfc3c9028d608b947 (patch)
tree46534a98bbefcd7b1f3faa5b52c138ab27db75b7 /contrib/tools/cython/Cython/Utility/arrayarray.h
parente9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (diff)
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'contrib/tools/cython/Cython/Utility/arrayarray.h')
-rw-r--r--contrib/tools/cython/Cython/Utility/arrayarray.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/contrib/tools/cython/Cython/Utility/arrayarray.h b/contrib/tools/cython/Cython/Utility/arrayarray.h
index a9e49237856..e9558ca6c36 100644
--- a/contrib/tools/cython/Cython/Utility/arrayarray.h
+++ b/contrib/tools/cython/Cython/Utility/arrayarray.h
@@ -125,20 +125,20 @@ static CYTHON_INLINE int resize(arrayobject *self, Py_ssize_t n) {
static CYTHON_INLINE int resize_smart(arrayobject *self, Py_ssize_t n) {
void *items = (void*) self->data.ob_item;
Py_ssize_t newsize;
- if (n < self->allocated && n*4 > self->allocated) {
+ if (n < self->allocated && n*4 > self->allocated) {
__Pyx_SET_SIZE(self, n);
- return 0;
- }
- newsize = n + (n / 2) + 1;
- if (newsize <= n) { /* overflow */
- PyErr_NoMemory();
- return -1;
+ return 0;
}
+ newsize = n + (n / 2) + 1;
+ if (newsize <= n) { /* overflow */
+ PyErr_NoMemory();
+ return -1;
+ }
PyMem_Resize(items, char, (size_t)(newsize * self->ob_descr->itemsize));
if (items == NULL) {
PyErr_NoMemory();
return -1;
- }
+ }
self->data.ob_item = (char*) items;
__Pyx_SET_SIZE(self, n);
self->allocated = newsize;