Kaydet (Commit) bb9c5f50 authored tarafından Neal Norwitz's avatar Neal Norwitz

PyObject_RichCompareBool() already returns -1, 0, or 1, so return its value

üst 884baa1e
......@@ -325,11 +325,7 @@ list_contains(PyListObject *a, PyObject *el)
for (i = 0, cmp = 0 ; cmp == 0 && i < a->ob_size; ++i)
cmp = PyObject_RichCompareBool(el, PyList_GET_ITEM(a, i),
Py_EQ);
if (cmp > 0)
return 1;
if (cmp < 0)
return -1;
return 0;
return cmp;
}
......
......@@ -266,11 +266,7 @@ tuplecontains(PyTupleObject *a, PyObject *el)
for (i = 0, cmp = 0 ; cmp == 0 && i < a->ob_size; ++i)
cmp = PyObject_RichCompareBool(el, PyTuple_GET_ITEM(a, i),
Py_EQ);
if (cmp > 0)
return 1;
if (cmp < 0)
return -1;
return 0;
return cmp;
}
static PyObject *
......
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