summaryrefslogtreecommitdiffstats
path: root/Objects/tupleobject.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2002-09-05 21:32:55 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2002-09-05 21:32:55 (GMT)
commitbb9c5f5032fb3ab46760566d1129562f44c07e89 (patch)
tree73b3c0a804a9cfc73b8a038e5b6d607fff6ed5dc /Objects/tupleobject.c
parent884baa1e6b9ed8115e2e4cea26614626e7a616dd (diff)
downloadcpython-bb9c5f5032fb3ab46760566d1129562f44c07e89.zip
cpython-bb9c5f5032fb3ab46760566d1129562f44c07e89.tar.gz
cpython-bb9c5f5032fb3ab46760566d1129562f44c07e89.tar.bz2
PyObject_RichCompareBool() already returns -1, 0, or 1, so return its value
Diffstat (limited to 'Objects/tupleobject.c')
-rw-r--r--Objects/tupleobject.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index a6b862f..6c2162a 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -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 *