Kaydet (Commit) 45d0b5cc authored tarafından Raymond Hettinger's avatar Raymond Hettinger

Use Py_RETURN_NONE macro where applicable.

üst 501f02cd
...@@ -652,20 +652,16 @@ listinsert(PyListObject *self, PyObject *args) ...@@ -652,20 +652,16 @@ listinsert(PyListObject *self, PyObject *args)
PyObject *v; PyObject *v;
if (!PyArg_ParseTuple(args, "iO:insert", &i, &v)) if (!PyArg_ParseTuple(args, "iO:insert", &i, &v))
return NULL; return NULL;
if (ins1(self, i, v) == 0) { if (ins1(self, i, v) == 0)
Py_INCREF(Py_None); Py_RETURN_NONE;
return Py_None;
}
return NULL; return NULL;
} }
static PyObject * static PyObject *
listappend(PyListObject *self, PyObject *v) listappend(PyListObject *self, PyObject *v)
{ {
if (app1(self, v) == 0) { if (app1(self, v) == 0)
Py_INCREF(Py_None); Py_RETURN_NONE;
return Py_None;
}
return NULL; return NULL;
} }
...@@ -2089,8 +2085,7 @@ listreverse(PyListObject *self) ...@@ -2089,8 +2085,7 @@ listreverse(PyListObject *self)
{ {
if (self->ob_size > 1) if (self->ob_size > 1)
reverse_slice(self->ob_item, self->ob_item + self->ob_size); reverse_slice(self->ob_item, self->ob_item + self->ob_size);
Py_INCREF(Py_None); Py_RETURN_NONE;
return Py_None;
} }
int int
...@@ -2190,10 +2185,9 @@ listremove(PyListObject *self, PyObject *v) ...@@ -2190,10 +2185,9 @@ listremove(PyListObject *self, PyObject *v)
int cmp = PyObject_RichCompareBool(self->ob_item[i], v, Py_EQ); int cmp = PyObject_RichCompareBool(self->ob_item[i], v, Py_EQ);
if (cmp > 0) { if (cmp > 0) {
if (list_ass_slice(self, i, i+1, if (list_ass_slice(self, i, i+1,
(PyObject *)NULL) != 0) (PyObject *)NULL) == 0)
return NULL; Py_RETURN_NONE;
Py_INCREF(Py_None); return NULL;
return Py_None;
} }
else if (cmp < 0) else if (cmp < 0)
return NULL; return NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment