summaryrefslogtreecommitdiffstats
path: root/Modules/_heapqmodule.c
diff options
context:
space:
mode:
authorThomas Wouters <thomas@python.org>2006-02-16 19:21:53 (GMT)
committerThomas Wouters <thomas@python.org>2006-02-16 19:21:53 (GMT)
commit13870b18f2a843d568f82c89b72f33dc427b9b23 (patch)
treeedf932bf4e1a7c136a4af7809a4d910a7d18f23c /Modules/_heapqmodule.c
parented6254acf289839467a77419566b475f5950f475 (diff)
downloadcpython-13870b18f2a843d568f82c89b72f33dc427b9b23.zip
cpython-13870b18f2a843d568f82c89b72f33dc427b9b23.tar.gz
cpython-13870b18f2a843d568f82c89b72f33dc427b9b23.tar.bz2
Also make _heapq.nlargest() use Py_ssize_t instead of ints, to iter over
lists and call Py_ssize_t-using helpers. All other code in this module was already adapted to Py_ssize_t.
Diffstat (limited to 'Modules/_heapqmodule.c')
-rw-r--r--Modules/_heapqmodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_heapqmodule.c b/Modules/_heapqmodule.c
index 3642769..f970cae 100644
--- a/Modules/_heapqmodule.c
+++ b/Modules/_heapqmodule.c
@@ -227,9 +227,9 @@ static PyObject *
nlargest(PyObject *self, PyObject *args)
{
PyObject *heap=NULL, *elem, *iterable, *sol, *it, *oldelem;
- int i, n;
+ Py_ssize_t i, n;
- if (!PyArg_ParseTuple(args, "iO:nlargest", &n, &iterable))
+ if (!PyArg_ParseTuple(args, "nO:nlargest", &n, &iterable))
return NULL;
it = PyObject_GetIter(iterable);