mirror of
https://github.com/python/cpython.git
synced 2025-07-19 01:05:26 +00:00
A static swapped_op[] array was defined in 3 different C files, & I think
I need to define it again. Bite the bullet and define it once as an extern, _Py_SwappedOp[].
This commit is contained in:
parent
7790c3b802
commit
f4aca755bc
4 changed files with 11 additions and 12 deletions
|
@ -4638,9 +4638,6 @@ half_richcompare(PyObject *self, PyObject *other, int op)
|
|||
return res;
|
||||
}
|
||||
|
||||
/* Map rich comparison operators to their swapped version, e.g. LT --> GT */
|
||||
static int swapped_op[] = {Py_GT, Py_GE, Py_EQ, Py_NE, Py_LT, Py_LE};
|
||||
|
||||
static PyObject *
|
||||
slot_tp_richcompare(PyObject *self, PyObject *other, int op)
|
||||
{
|
||||
|
@ -4653,7 +4650,7 @@ slot_tp_richcompare(PyObject *self, PyObject *other, int op)
|
|||
Py_DECREF(res);
|
||||
}
|
||||
if (other->ob_type->tp_richcompare == slot_tp_richcompare) {
|
||||
res = half_richcompare(other, self, swapped_op[op]);
|
||||
res = half_richcompare(other, self, _Py_SwappedOp[op]);
|
||||
if (res != Py_NotImplemented) {
|
||||
return res;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue