diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-01-23 07:47:21 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2017-01-23 07:47:21 (GMT) |
commit | 228b12edcce49649d6befa3c03dbcefd5a22ae76 (patch) | |
tree | 1066be6909fb981fcf30e1a8e224d43567bd9b92 /Modules/arraymodule.c | |
parent | 60e6e962bac6a668d0df539ebf526a0a1c69eacd (diff) | |
download | cpython-228b12edcce49649d6befa3c03dbcefd5a22ae76.zip cpython-228b12edcce49649d6befa3c03dbcefd5a22ae76.tar.gz cpython-228b12edcce49649d6befa3c03dbcefd5a22ae76.tar.bz2 |
Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE wherever
possible. Patch is writen with Coccinelle.
Diffstat (limited to 'Modules/arraymodule.c')
-rw-r--r-- | Modules/arraymodule.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c index f1469df..464820d 100644 --- a/Modules/arraymodule.c +++ b/Modules/arraymodule.c @@ -1007,8 +1007,7 @@ ins(arrayobject *self, Py_ssize_t where, PyObject *v) { if (ins1(self, where, v) != 0) return NULL; - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /*[clinic input] @@ -1122,8 +1121,7 @@ array_array_remove(arrayobject *self, PyObject *v) if (cmp > 0) { if (array_del_slice(self, i, i+1) != 0) return NULL; - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } else if (cmp < 0) return NULL; @@ -1185,8 +1183,7 @@ array_array_extend(arrayobject *self, PyObject *bb) { if (array_do_extend(self, bb) == -1) return NULL; - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /*[clinic input] @@ -1315,8 +1312,7 @@ array_array_byteswap_impl(arrayobject *self) "don't know how to byteswap this array type"); return NULL; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /*[clinic input] @@ -1349,8 +1345,7 @@ array_array_reverse_impl(arrayobject *self) } } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /*[clinic input] @@ -1453,8 +1448,7 @@ array_array_tofile(arrayobject *self, PyObject *f) } done: - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /*[clinic input] @@ -1491,8 +1485,7 @@ array_array_fromlist(arrayobject *self, PyObject *list) } } } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /*[clinic input] @@ -1557,8 +1550,7 @@ frombytes(arrayobject *self, Py_buffer *buffer) buffer->buf, n * itemsize); } PyBuffer_Release(buffer); - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } /*[clinic input] |