diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2009-11-15 13:58:49 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2009-11-15 13:58:49 (GMT) |
commit | 6f1d04945b98cd66b95131833942526c85bbb867 (patch) | |
tree | 7c6bdef12d242b18389d4c46e6c984aadadf3b98 /Objects/typeobject.c | |
parent | f4243f6d1f1a7512751d26235a492c24a9a4c76c (diff) | |
download | cpython-6f1d04945b98cd66b95131833942526c85bbb867.zip cpython-6f1d04945b98cd66b95131833942526c85bbb867.tar.gz cpython-6f1d04945b98cd66b95131833942526c85bbb867.tar.bz2 |
Issue #6970: Remove redundant calls made when comparing objects.
Diffstat (limited to 'Objects/typeobject.c')
-rw-r--r-- | Objects/typeobject.c | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 24866ff..be4b6f8 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -5068,7 +5068,7 @@ static char *name_op[] = { }; static PyObject * -half_richcompare(PyObject *self, PyObject *other, int op) +slot_tp_richcompare(PyObject *self, PyObject *other, int op) { PyObject *func, *args, *res; static PyObject *op_str[6]; @@ -5091,28 +5091,6 @@ half_richcompare(PyObject *self, PyObject *other, int op) } static PyObject * -slot_tp_richcompare(PyObject *self, PyObject *other, int op) -{ - PyObject *res; - - if (Py_TYPE(self)->tp_richcompare == slot_tp_richcompare) { - res = half_richcompare(self, other, op); - if (res != Py_NotImplemented) - return res; - Py_DECREF(res); - } - if (Py_TYPE(other)->tp_richcompare == slot_tp_richcompare) { - res = half_richcompare(other, self, _Py_SwappedOp[op]); - if (res != Py_NotImplemented) { - return res; - } - Py_DECREF(res); - } - Py_INCREF(Py_NotImplemented); - return Py_NotImplemented; -} - -static PyObject * slot_tp_iter(PyObject *self) { PyObject *func, *res; |